Re: From a bash array to a csv file line?
- From: Michal Nazarewicz <mina86@xxxxxxx>
- Date: Thu, 28 Sep 2006 22:09:58 +0200
casioculture@xxxxxxxxx writes:
I want to put all my variables in an array and then have bash "read"
the input from the user (me) at runtime for each and then "echo" their
values with the date to a csv file so that all would be comma-separated
on the same line.
#v+
for varname in FOO BAR BAZ QUX; do
printf "Enter $varname: "
read $varname
done
printf '%s,%s,%s,%s\n' "$FOO" "$BAR" "$BAZ" "$QUX"
#v-
?
--
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +--<mina86*tlen.pl>--<jid:mina86*jabber.org>--ooO--(_)--Ooo--
.
- References:
- From a bash array to a csv file line?
- From: casioculture
- From a bash array to a csv file line?
- Prev by Date: Re: using sed to retrieve the hour in a timestamp
- Next by Date: Re: From a bash array to a csv file line?
- Previous by thread: From a bash array to a csv file line?
- Next by thread: Re: From a bash array to a csv file line?
- Index(es):
Relevant Pages
|