I've been trying to run a simple script named 'post-install.sh':
#!/bin/zsh
sudo apt-get update -y
This script is in ~/bin.
Relevant commands:
% echo $PATH
/home/$USER/bin:/usr/local/bin:/home/$USER/bin:/usr/local/bin:/usr/bin
My ~/.zshrc has:
export PATH=$HOME/bin:/usr/local/bin:$PATH
My ~ directory has (among others):
.bashrc
.profile
.xinitrc
.zshrc
My /etc directory also has a zsh file but I haven't modified it. My ~/.bashrc doesn't seem to have anything relevant (I've tried adding 'source ~/.bashrc' to my .zshrc).
I'm running Debian 10 on a Thinkpad x230.
EDIT: I've tried running my script from '/usr/local/bin' as well. I've also tried running my script as:
sudo post-install.sh
sudo zsh post-install.sh
post-install.sh
My script does run when I run the absolute path:
sudo ~/bin/post-install.sh
rehash
(in the interactivezsh
session) make it available aspost-install.sh
?