On Mon, Apr 16, 2012 at 10:37 PM, Sara Rolfe <[email protected]> wrote: > I am new to both scripting and SGE, so I don't understand why, but I need to > escape all the variables in my script. For example, > > awk "NR==$SGE_TASK_ID" /myPath/fileList.txt > > produces a blank output, but if I escape the env variable, like: > > awk "NR==\$SGE_TASK_ID" /myPath/fileList.txt > > then I get the correct line from the text file. The problem is when I try > to assign this output to a variable. I still need to use the escape, but I > think it's not being passed correctly.
I usually use single quotes for awk. It prevents shell expansion of the symbols. (Shell expansion applies to double quoted arguments but not single quoted ones.) .George -- George Georgalis, (415) 894-2710, http://www.galis.org/ _______________________________________________ users mailing list [email protected] https://gridengine.org/mailman/listinfo/users
