I am having a bash script that is executing another bash script:
ex:
script name "rotator" is calling script name "s3-get" like below
!# /bin/bash
...
./s3-get {and params here}
All commands as "cat", "basename" etc. run correctly here
Within the "s3-get" script there is code as:
!# /bin/bash
cat > /dev/null << EndOfLicense
...
readonly weAreKnownAs="$(basename $0)"
...
main "$@"
So, if I simply execute the s3-get script directly from shell, it runs perfectly. When I try to execute it from "rotator" script, I get the error "cat: command not found". I can fix this by changing "cat" with "/bin/cat" just that I don't think this is correct since, as I stated above, the script runs correctly when executed as standalone. If I fix the "cat" command as above, the next error that raises is "basename: command not found", then "main: command not found"
I am pretty new to shell programming, so any help is appreciated.
Thank you
PATHvariable, which is how the shell finds commands when you don't give it a fully qualified command name like/bin/cat. - larsks!#rather than the correct#!), but spaces after the#!are OK, although unusual - "rather, blanks after the shebang have traditionally been allowed" (en.wikipedia.org/wiki/Shebang_(Unix)) - mklement0