Xref: utzoo comp.unix.xenix:6039 comp.unix.questions:13688 comp.unix.wizards:16188 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!ndcheg!uceng!kamat From: kamat@uceng.UC.EDU (Govind N. Kamat) Newsgroups: comp.unix.xenix,comp.unix.questions,comp.unix.wizards Subject: Re: SysV echo Keywords: rm cat mv regexp Message-ID: <1026@uceng.UC.EDU> Date: 18 May 89 01:22:54 GMT References: <128@tdl.UUCP> <7170@bsu-cs.bsu.edu> <12970@ut-emx.UUCP> <536@visdc.UUCP> <17548@mimsy.UUCP> Reply-To: kamat@uceng.uc.edu (Govind N. Kamat) Followup-To: comp.unix.xenix Distribution: usa Organization: College of Engg., Univ. of Cincinnati Lines: 32 In article <17548@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: + There is a solution (albeit ugly): + + cat << end + $foo + end + + but you may need to do something more. To keep echo from munching away + backslashes, you might do this: + + qfoo=`cat << end | sed 's/\\\\/\\\\\\\\' + $foo + end` + + except that, due to vagaries of Bourne's implementation, it does not work. + (It might work in ksh.) ... The following works okay in both Bourne and Korn shells on our machine (HP-UX, which is basically SVR2): foo='a\b\\c\\\d\\\\e\\\\\f' qfoo=$foo cat <<-EOF $qfoo EOF On ksh, one can use the raw option of echo, echo -r instead. -- Govind N. Kamat College of Engineering kamat@uceng.UC.EDU University of Cincinnati Cincinnati, OH 45221, USA