我有此腳本外殼,將其解壓並安裝的libpcap庫腳本不提取焦油
#!/bin/sh
PATH=/usr/src
wget=/usr/bin/wget
tar=/bin/tar
echo "###############"
echo "INSTALL LIBPCAP"
echo "###############"
$tar -xvf libpcap-1.3.0.tar.gz
cd libpcap-1.3.0
./configure --prefix=/usr
make && make install
當我執行它,我有這樣的錯誤
tar (child): gzip: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
/bin/tar: Child returned status 2
/bin/tar: Error is not recoverable: exiting now
./install.sh: 14: cd: can't cd to libpcap-1.3.0
可能重複的[無法解壓一個完整的目錄使用tar -cvpzf](http://stackoverflow.com/questions/9749466/cant-untar-a-complete-directory-using-tar-cvpzf) – thumbmunkeys
似乎像你的系統上缺少gzip或sh找不到它。檢查gzip是否存在,如果是,請檢查它是否在SH的搜索路徑中(在腳本中可能有「echo $ PATH」,並查看gzip所在的文件夾是否位於路徑中) – Nidhoegger
這是$ PATH的內容/root/.embulk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games – jarjar