Summary:Bourne shell question

From: Larry Chin (Larry_Chin@cchtor.ca.cch.com)
Date: Tue Oct 04 1994 - 19:33:19 CDT


                        ORIGINAL QUESTION

I am attempting to reassign the value of a variable in the following such
that the original variable has more characters added to the initial value.

For example:
============
OUTPUT_STRING="Hello"
SECOND_STRING="how are you?"
OUTPUT_STRING="$OUTPUT_STRING" \n "$SECOND_STRING"

Of course that does not work.

Basically I would like to reassign $OUTPUT_STRING string to read:

        Hello,
        how are you ?

Would some kind Bourne shell guru tell me how this is done or if it is
even possible ?

                        SOLUTION
        

As it turns out I could have avoided a posting if I had been using the right
version of echo. The /usr/5bin/echo does what I want, as opposed to the
/usr/bin/echo, as the form I was using above would have worked with the echo
in 5bin. Under System V unix ( like Solaris ) the echo is the echo that
will interpret newlines instead of eating them.

Special thanks to Jim Rodgers who pointed out that the problem really is
not with echo per se but rather with the IFS variable set in the Bourne
shell by default to include spaces, tabs and newlines, the latter being the
thing giving me the problem.

Tue Oct 4 07:03:04 EDT 1994
===========================================================================
Larry Chin {larry@cchtor.ca.cch.com} System/Network Administrator
CCH Canadian Ltd. (416) 441-4001 ext. 349
===========================================================================

With a rubber duck, one's never alone.
                -- "The Hitchhiker's Guide to the Galaxy"

Thanks to:

sgs@hoccson.att.com
charest@CANR.Hydro.Qc.CA (Claude Charest)
etnibsd!vsh@uunet.uu.net (Steve Harris)
dburwell@telecom.telecom.com (David Burwell (7929))
mike_wagner@il.us.swissbank.com (Mike Wagner)
sgs@hoccson.att.com
operator@snt.com (Systems_Group)
James.E.Coby.Jr@cdc.com (James Coby)
tkevans@eplrx7.es.duPont.com (Tim Evans)
Ian MacPhedran <Ian_MacPhedran@dvinci.usask.ca>
scowles@scheffer.Stanford.EDU (S. Cowles)
zeke@fnoc.navy.mil (William T. Reckas)
Steve Kite <stevek@zorro.ptp.hp.com>
edsdrd.eds.com!rbt@edsr.eds.com (Randy Talsma)
Simon Boddy <boddys@river.it.gvsu.edu>
Christopher Neufeld <neufeld@physics.utoronto.ca>
Guy Polis <polis_guy@jpmorgan.com>
Michael Ryan <mike@bakerryan.ie>
don@mars.dgrc.doc.ca (Donald McLachlan)
John Warren <jwarren@nhtsa.dot.gov>
david@srv.PacBell.COM (David St. Pierre)
pallas@oclc.org (George Pallas)
Robert Sargent <sargent@SGT.COM>
Nate Itkin <Nate-Itkin@ptdcs2.intel.com>
john@oncology.uthscsa.edu (John Justin Hough)
"Mark E. Almeida" <mealmei@kn.PacBell.COM>
"Henry Katz" <hkatz@lehman.com>
Peter.Samuel@nms.otc.com.au (Peter Samuel)
scott@pnw.pnw.opensys.com (Scott McBain)
odt@lci.com (Dan Transue)
Torsten Metzner <tom@uni-paderborn.de>
trevor@if.ssci.liv.ac.uk (Trevor Morrison)
rauthenberg@HHI.DE (Stefan Rauthenberg)
steve@cegelecproj.co.uk (Steve_Kilbane)
gcp@lnsp00.com (Garry Perratt)
glenn@uniq.com.au (Glenn Satchell - Uniq Professional Services)
Jim Rogers <jimr@col.hp.com>
Gregory Bond <gnb@melba.bby.com.au>
dattier@mcs.com (David W. Tamkin)
sunm@erm.oz.au (Brett Newton-Palmer(Sun Admin))
thi (san antonio-101-237 is FASTER than wolfe-237!) <ttn@netcom.com>
Lenny Turetsky <lturetsk@aida.econ.yale.edu>



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:11 CDT