I am working on a lengthy script (parentScript), part of which generates another script (childScript)
I am using a method I cribbed from Andrina's TempAdmin.sh script, namely:
echo"childScript line 1
childScript line n" > location
This has worked well for me for plists and scripts that do not have variables. BUT... if I send through a variable, the variable is calculated when the childScript is deployed. For instance, if the parentScript sends
X=date '+%m%d%Y:%H:%M:%S'
the childScript receives X=03052015:11:43:49 and then fails to execute properly.
I can get around this by deploying the childScript separately, however I would prefer that the childScript only exist while the parentScript is running.
Thanks in advance.