got it!

$buffer=`cat some_file`
echo $buffer <- ignores newlines
echo "$buffer" <- doesn't ignore newlines

reasoning: http://www.chains.ch/stuff/books/unix/upt/ch08_14.htm scroll to multiline quoting.

should have googled harder ;-)

Aram Yegenian <[EMAIL PROTECTED]> wrote:
hi,

how can i store a multiline text in a shell variable, is it even possible?

what i tried till now:
$buffer=`cat some_file`
which removes the newlines...

and...
while read x
do
        buffer="$buffer $x"
done
which again removes the newlines.

either it can't be done OR i forgot shell programming OR it's a really simple solution and i can't put my finger on it!
any ideas?

Yahoo! FareChase - Search multiple travel sites in one click. _______________________________________________
General mailing list
[email protected]
http://mail.jolug.org/mailman/listinfo/general_jolug.org

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

_______________________________________________
General mailing list
[email protected]
http://mail.jolug.org/mailman/listinfo/general_jolug.org

Reply via email to