Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site turtlevax.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!gargoyle!crsp!pesnta!amd!turtlevax!ken From: ken@turtlevax.UUCP (Ken Turkowski) Newsgroups: net.unix,net.unix-wizards Subject: Re: Sort problems Message-ID: <636@turtlevax.UUCP> Date: Tue, 22-Jan-85 15:30:28 EST Article-I.D.: turtleva.636 Posted: Tue Jan 22 15:30:28 1985 Date-Received: Wed, 23-Jan-85 08:26:27 EST References: <2041@pegasus.UUCP> Reply-To: ken@turtlevax.UUCP (Ken Turkowski) Followup-To: net.unix-wizards Distribution: net Organization: CADLINC, Inc. @ Menlo Park, CA Lines: 45 Keywords: here documents Xref: watmath net.unix:3419 net.unix-wizards:11688 Summary: Use the quote in here documents In article <2041@pegasus.UUCP> mzal@pegasus.UUCP (Mike Zaleski) writes: > > From: naiman@pegasus.UUCP (Ephrayim J. Naiman) > Okay you sort experts why do these two sorts not work ? > > ... > > sort << ! > Abe > $Aba > ! > >Try escaping the $ with a backslash when entering this to the shell. >By the way, the ASCII value of '$' is also less than that of 'A'. > >-- Mike^Z [allegra!, ihnp4!] pegasus!mzal Zaleski@Rutgers Even better, put quotes around the !: sort << '!' Abe $Aba ! Which produces the output: $Aba Abe To quote from the Bourne shell documentation: << word The shell is read up to a line the same as word, or end of file. The resulting document becomes the standard input. If any character of word is quoted, no interpretation is placed upon the characters of the document; otherwise parameter and command substitution occurs, \newline is ignores, and \ is used to quote the characters \ $ ' and the first character of word. The C shell has analogous propeties. -- Ken Turkowski @ CADLINC, Menlo Park, CA UUCP: {amd,decwrl,nsc,seismo,spar}!turtlevax!ken ARPA: turtlevax!ken@DECWRL.ARPA