I’m having trouble doing something basic with csh. I have a string:
set newCmd = "$expansionCmd –option1 –option2 …"
And I’m creating an array of these strings, which I later want to execute:
set expansionCmdList = ($expansionCmdList[*] "$newCmd")
#I also tried without quotes, e.g. just $newCmd
Finally I try to iterate over and execute these commands:
foreach exCmd ($expansionCmdList)
`exCmd` #execute it in the shell
end
However the problem is that the array entries are not the full string, but every part of the string separated by whitespace, i.e. the first entry is just “$expansionCmd”, the next entry would be “—option1” etc.
Apologies in advance for using c shell, my company's code base is stuck with it.