我试图编译这个脚本,但我总是得到以下错误“命令未找到”? [英] I tried to compile this script but I always get the following error “command not found”?

查看:76
本文介绍了我试图编译这个脚本,但我总是得到以下错误“命令未找到”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

i tried running this script but it didn't work! i typed ./FindSCT.bash visit.bash where is FindSC.bash is the name of my script and visit.bash is the file i want to get my input from. i tried to type chmod 700 FindSCT i also wrote chmod +x FindSCT.bash and also typed PATH="${PATH}:." but non of these things actually helped. also i made sure that the two files are in the same directory! any help would be very appreciated!
also i tried to add " " around ($1 also $2).. still command not found 

if i do ls i get this :(the two scripts are in the same directory :/
FindSCT.bash   visit.bash
!





我尝试了什么:





What I have tried:

<pre>  <pre>#!/bin/bash
function ssort {
echo sort -rnk2 $1 | sort -rsk3 | uniq -2 | cut -d" " -f3 | wc -l
}
if (( $# == 1 )); then 
echo -rnk2 $1 | sort -rsk3 | uniq -2 | cut -d" " -f3
fi
if (( $# == 2 )); then 
   nn=`ssort $*`
     if (( ${nn} > $2 )); then
     echo -rnk2 $1 | sort -rsk3 | uniq -2 | cut -d" " -f3
  fi 
    echo -rnk2 $1 | sort -rsk3 | uniq -2 | cut -d" " -f3 | head -n{$2}
fi 

推荐答案

{PATH}:但这些东西实际上没有帮助。我也确保这两个文件在同一个目录中!任何帮助都会非常感激!
我也尝试添加arou nd(
{PATH}:." but non of these things actually helped. also i made sure that the two files are in the same directory! any help would be very appreciated! also i tried to add " " around (


1也


2)..仍然没有找到命令

如果我这样做我得到这个: (这两个脚本在同一个目录中:/
FindSCT.bash visit.bash
2).. still command not found if i do ls i get this :(the two scripts are in the same directory :/ FindSCT.bash visit.bash !





< b>我尝试了什么:





What I have tried:

<pre>  <pre>#!/bin/bash
function ssort {
echo sort -rnk2


这篇关于我试图编译这个脚本,但我总是得到以下错误“命令未找到”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆