Dear JAMF members,
In some of my casper scripts, which are initiated at boot time i use command substitution.
Somehow they are not interpreted and turned into empty strings.
A small example;
cat << my_awesome_script > /tmp/the_script.sh
jenkins_version=$(ls -tr1 /usr/local/Cellar/jenkins/ | tail -n1)
ls -tr1 /usr/local/Cellar/jenkins/ | tail -n1
the contents of my script looks like this after imaging (the scripts are executed after the imaging process),
So somehow casper must parse the scripts and removes certain characters or complete strings.
Does anyone have the same experience? It would help me big time if someone could shine a light on this.
Currently i'm on 9.64 (will be upgraded to 65 soon).
I make use of tildes which do work fine actually.
In the meantime i did more testing and it seems to work if i escape the dollar signs like this,
also an exit status variable needs to be escaped; $?
the same counts for backticks, this example works; `ls -1 /tmp | tail -n1`
@davidacland: interesting that it works for you, just like i try to use it.
could it be a problem related to the type of characters? UTF-8 vs something else?