Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!oddjob!gargoyle!ihnp4!homxb!hou2d!avr From: avr@hou2d.UUCP (Adam V. Reed) Newsgroups: comp.unix.wizards Subject: Re: embedded newlines in shell variable? Message-ID: <1508@hou2d.UUCP> Date: Wed, 12-Aug-87 17:16:01 EDT Article-I.D.: hou2d.1508 Posted: Wed Aug 12 17:16:01 1987 Date-Received: Sat, 15-Aug-87 03:08:18 EDT References: <228@cjsa.UUCP> Organization: AT&T Bell Laboratories, Holmdel Lines: 11 Keywords: sed sh shell Summary: use "${ACTION}" In article <228@cjsa.UUCP>, jeff@cjsa.UUCP (C. Jeffery Small) writes: > On the other hand, attempting to embed actual newlines (^J) within the > assignment (ie. ACTION="-e '\$a\^JNEW LINE OF MATERIAL'") does not work > since the shell substitutes the ^J with a single space. Yes it does work - check it with $ echo "${ACTION}". But you need to protect shell parameters with " " to have the shell pass them intact to a command. Incidentally, you don't need the \ before a literal newline inside single quotes. Adam Reed (hou2d!avr)