Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!uflorida!travis!brad From: brad@SSD.CSD.HARRIS.COM (Brad Appleton) Newsgroups: comp.unix.questions Subject: C-shell variables Summary: How do I get a new-line into one using eval? Message-ID: <728@travis.csd.harris.com> Date: 17 Aug 90 22:16:14 GMT Sender: news@travis.csd.harris.com Organization: Harris Computers Systems Division, Fort Lauderdale,FL Lines: 52 I need to have a C shell variable contain a new-line. Apparently I can do this at the shell-prompt using: % set foo=a"\ "b % echo $foo:q a b but the following does not work: % set foo=a\ b % echo $foo:q a Regardless, I am required to put my variable setting in a file named "tmp" and set the variable using: % eval `cat tmp` where "tmp" contains the command to set the variable foo! Unfortunately, what worked at the shell prompt does not seem to work when I put it in a file and use eval (regardless of whether or not I use backslashes). ??? SO what must I put into "tmp" to get a newline into $foo:q ??? Please dont post solutions that dont use "eval `cat file`"; such solutions will be of no use to me. Please dont tell me not to use csh either; I dont usually but in this particular case it is part of my requirements-spec. To make matters worse, I cant go translating all newlines in "tmp" to something else (and then back again) because there may be other variable settings in "tmp" which may be terminated by a newline (and/or a semicolon). This one is giving me a lot of grief because I was hoping that what works on the command-line would work in "tmp" (which doesnt seem to be the case for my csh anyway). PS - If youre curious, the reason I have to deal with all the above is that I have a program that will be taking input and spitting out C-shell variable settings. The only character I cant seem to preserve from the input is the newline character. advTHANXance ______________________ "And miles to go before I sleep." ______________________ Brad Appleton brad@travis.ssd.csd.harris.com Harris Computer Systems ...!uunet!hcx1!brad Fort Lauderdale, FL USA ~~~~~~~~~~~~~~~~~~~~ Disclaimer: I said it, not my company! ~~~~~~~~~~~~~~~~~~~