I have an executable script install_packages.sh
in /home/etienne/admin
folder. The directory's path is added to $PATH
variable from /etc/bash.bashrc
. When I type #echo $PATH
I see that the variable does contain the directory's path. However, when I try to run the script from other directories, shell says that command not found
. From within own directory, the script runs fine if call it as ./install_packages.sh
. The script itself is ordinary - it contains only apt-get install <package>
lines. I am really baffled
Output of the echo $PATH | xxd
0000000: 2f68 6f6d 652f 6461 6e69 656c 2f61 646d /home/etienne/adm
0000010: 696e 3a2f 7573 722f 6c6f 6361 6c2f 7362 in:/usr/local/sb
0000020: 696e 3a2f 7573 722f 6c6f 6361 6c2f 6269 in:/usr/local/bi
0000030: 6e3a 2f75 7372 2f73 6269 6e3a 2f75 7372 n:/usr/sbin:/usr
0000040: 2f62 696e 3a2f 7362 696e 3a2f 6269 6e3a /bin:/sbin:/bin:
0000050: 2f75 7372 2f67 616d 6573 3a2f 7573 722f /usr/games:/usr/
0000060: 6c6f 6361 6c2f 6761 6d65 730a local/games.
echo "$PATH" | xxd
to the question. Also, check that the error isn't coming from inside of the script: doesn't it call a command that's not found?apt-get install
lines. If I run them from the shell they work./install_packages.sh
?# echo $PATH
, does that mean you are logged in as root? Are you runningecho $PATH
andinstall_packages.sh
as the same user? Is either of the commands run withsudo
?