I have a script in FreeBsd 11% cat my_script.sh #!/usr/local/bin/zsh# [........]It has x attribute:-rwxr-xr--   1 root  wheel  669 Jun 14 02:45 my_script.shMy shell is zsh. When I'm trying to execute it, I get an error. It has to do with the way I'm invoking it:% sudo ./my_script.sh var1                  sudo: ./my_script.sh: command not found% sudo my_script.sh var1 sudo: my_script.sh: command not found% sudo source my_script.sh var1sudo: source: command not foundWhat's the matter?update:I've changed my shell to bash, rebooted, changed the #! to bash and now I have:$ sudo ./my_script.sh test9sudo: ./my_script.sh: command not found
A bash/zsh script isn't getting invoked from a terminal in FreeBsd, neither in bash nor in zsh
bash;shell script;shell;zsh;freebsd