我是一个unix新手,我有一个unix命令我试图运行,但我得到一个“GREP:找不到”的错误。我看着$ PATH,并没有看到任何类似的grep(不知道这就是我正在寻找任何虽然)...
的命令是这样的:
testabcd=$(bteq << EOF 2>&1 |grep '^>' |sed -e "s/^>//"
.LOGON server/user, pass
DATABASE schema;
.set width 2000;
.set titledashes off;
SELECT '>'||COUNT(*) FROM schema1.table1;
.LOGOFF;
.QUIT;
.EXIT
EOF)
echo "The count is: " $testabcd
然后我得到这些错误:
-ksh: SED: not found (No such file or directory)
>echo "The count is: " $testvarabcd
THE DATA IS:
>-ksh: GREP: not found
*** Error: The following error was encountered on the output file.
*** Error: Broke pipe
*** Warning: Canceling the rest of the output
如果grep不在PATH中,是否需要安装它?如果没有,我可以在命令中设置路径,并且如何搜索grep路径的位置?
你可以做'哪个grep'?并在此处粘贴输出。 – vidit 2014-10-27 23:18:07
我得到“/ bin/grep” – user2061886 2014-10-27 23:19:19
您的错误消息显示命令的所有CAPS。 'GREP'不一样'grep'! – 2014-10-27 23:20:00