in cshell: How to I set a variable to the command line output?
问题 I do want to start a batch job that generates a jobid as output. How can I save the jobid as environmental variable and reuse it in the cshell script? Thanks and best wishes, Rollz 回答1: Use backticks to substitute the output of a command into the command line. To set an ordinary variable: set varname = `start_batch_job` To set an environment variable: setenv varname `start_batch_job` You should generally avoid scripting in C-shell, it has lots of problems that make it poor as a scripting