Nexec –e cmd /c “echo %VAR%”
how would I then access the result of the "echo %VAR%" as a variable in the NSH script?
FOO=”$(nexec –e cmd /c “echo %VAR%”)”
Well. . . I don't know what is wrong, but when I use the Nexec –e cmd /c “echo %VAR%” or FOO=”$(nexec –e cmd /c “echo %VAR%”)” I get the following in the run log:
Error 09/29/2015 17:48:48 The system cannot find the file specified.
Are you cd’d into the target? and it should be a lowercase n in nexec.
% FOO="$(nexec -e cmd /c "echo %TEMP%" | tr -d '[:cntrl:]')"
% echo “$”
You also need to add the tr (or something) to strip off the windows end-of-line character.
Thanks for the help. I think that there may have been some character funkiness going on with my earlier attempts. When I copied/pasted your code from earlier posts I had the problem, with this latest post, it works like a charm.