Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!usc!ucsd!hub.ucsb.edu!spectrum.CMC.COM!lars From: lars@spectrum.CMC.COM (Lars Poulsen) Newsgroups: comp.unix.questions Subject: Re: C-shell variables Message-ID: <1990Aug20.233436.21895@spectrum.CMC.COM> Date: 20 Aug 90 23:34:36 GMT References: <728@travis.csd.harris.com> Organization: Rockwell CMC Lines: 28 In article <728@travis.csd.harris.com> brad@SSD.CSD.HARRIS.COM (Brad Appleton) writes: >I need to have a C shell variable contain a new-line. >??? 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. Together, let's RTFM: > CSH(1) USER COMMANDS CSH(1) > > Command Substitution > A command enclosed by backquotes (`...`) is performed by a > subshell. Its standard output is broken into separate words > at each SPACE character, TAB and NEWLINE; null words are > discarded. This text replaces the backquoted string on the > current command line. Within double-quotes, only NEWLINE > characters force new words; SPACE and TAB characters are > preserved. However, a final NEWLINE is ignored. It is > therefore possible for a command substitution to yield a > partial word. In other words, it is impossible to have a newline come out of a backquote substitution, because it will be turned into a space. -- / Lars Poulsen, SMTS Software Engineer CMC Rockwell lars@CMC.COM