Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: kinda perl split ...
- X-seq: zsh-users 10054
- From: Marc Chantreux <marc.chantreux@xxxxxxxxxxxxxxxxxx>
- To: Dominic Mitchell <dom@xxxxxxxxxxxxxxxx>
- Subject: Re: kinda perl split ...
- Date: Tue, 21 Mar 2006 15:22:29 +0100
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20060321135118.GA92936@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <442002B4.8080501@xxxxxxxxxxxxxxxxxx> <20060321135118.GA92936@xxxxxxxxxxxxxxxxxxxxxx>
Dominic Mitchell wrote:
echo foo bar | while read a b junk
do
echo "a=$a b=$b"
done
so if the separator is ':', you should redefine IFS
oldIFS=$IFS
IFS=':'
echo foo bar | while read a b junk
do
echo "a=$a b=$b"
done
IFS=$oldIFS
oldIFS=
or with a subshell:
( IFS=':'
echo foo bar | while read a b junk
do
echo "a=$a b=$b"
done )
Messages sorted by:
Reverse Date,
Date,
Thread,
Author