SCIENTIFIC-LINUX-USERS Archives

June 2014

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
ToddAndMargo <[log in to unmask]>
Reply To:
ToddAndMargo <[log in to unmask]>
Date:
Sat, 7 Jun 2014 17:38:35 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (25 lines)
Hi All,

Bash: I am trying to use a variable to hold
a log and add to it as I go.  I can do this
with a temp file, but I'd rather do it with
a variable.

I have gotten this far:

A=$(echo -e  "abc\n")
A="$A"$(echo -e  "def\n")
A="$A"$(echo -e  "ghi\n")

echo $A
abcdefghi

echo -e $A
abcdefghi

What am I doing wrong?  Is it better to just break
down and just use a file?

Many thanks,
-T

ATOM RSS1 RSS2