Closed benducklow closed 8 years ago
Hi @benducklow !
Wanted to get back to you on this. The reason you're seeing that error is because you're overriding the script's interpreter, aka shebang, by calling it as sh /path/to/script.sh
When you do this, it tells Terminal to run the script as a Bourne shell script, but its coded as a Bash script, #!/bin/bash
vs #!/bin/sh
Some of the syntax used in the script is bash specific, such as the process substitution command. The syntax looks something like this in general:
while read line; do
echo "$line"
done < <(ls ~/Documents/)
This doesn't work in /bin/sh, but does in /bin/bash. As long as the script is executable, just call it by its path and name in Terminal and it should run, i.e. /path/to/script.sh
and it should work.
Try that and post back if there's still an issue, but I'm pretty certain that will solve it for you.
Cheers.
Hi @benducklow, just checking in again. Did my post above help solve this for you? I'd like to close this issue if so. Please let me know, thanks.
Yes, just running the script via the /path/to/script.sh
without any prefixes was the trick. Thanks much for the responses (and the script)!
Good to hear its working now. Thanks for the reply.
Seeing the below errors when trying to run this script against Casper 9.82:
I've confirmed the script has execution rights. The user account I entered in the script does have full Auditor privileges as well. Thanks.