我是一個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