From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079058316070.tru64-unix-managers.marc@archive.invalid> From: "Ernie Bisson, MIT Bates Linear Accelerator" Date: Mon, 26 Jul 1999 20:03:31 +0000 To: tru64-unix-managers Subject: Setting a variable which includes curly brackets X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079058316070 I have a script called csh.cshrc that contains the following line setenv PATH "${PATH}:/usr/X11R6/bin:/usr/local/bin" With a tcsh script, I want to change the value of PATH by extracting what is between the double quotes and add to it using "sed". The command, grep 'setenv PATH' csh.cshrc | awk -F\" '{printf("%s\n",$2)}' Produces the desired output, ${PATH}:/usr/X11R6/bin:/usr/local/bin If I try to set a shell variable to contain the above string, then the curley brackets get lost. The commands, set Path = `grep 'setenv PATH' csh.cshrc | awk -F\" '{printf("%s\n",$2)}'` echo ${Path} Produce the output, $PATH:/usr/X11R6/bin:/usr/local/bin Is there a way that I can preserve the brackets in a shell variable? Thanks for any help, Ernie -------------------------------------------------------------------------------- Ernie Bisson M.I.T. Bates Linear Accelerator P.O. Box 846 Middleton, Massachusetts 01949-2846 (508) 774-2370 or (617) 253-9218 E-Mail : bisson@mit.edu --------------------------------------------------------------------------------