Re: mapfile usage

2009-02-04 Thread Alex Reed
On Feb 4, 2:59 pm, Stephane CHAZELAS wrote: > 2009-02-4, 10:50(-08), Alex Reed: > > > Can someone please explain how 'mapfile' should be used?  I am trying: > > > cat file.txt | mapfile > > for i in ${MAPFILE};do echo $i; done > > > and I see no output. > > mapfile would be run in a subshell. > >

Re: mapfile usage

2009-02-04 Thread Stephane CHAZELAS
2009-02-4, 10:50(-08), Alex Reed: > Can someone please explain how 'mapfile' should be used? I am trying: > > cat file.txt | mapfile > for i in ${MAPFILE};do echo $i; done > > and I see no output. mapfile would be run in a subshell. Try mapfile < file.txt Note that the for loop syntax above is

Re: Migrating from tcsh to bash (issues)

2009-02-04 Thread Chet Ramey
Stephane CHAZELAS wrote: > > Oops! I hadn't realised we were on the bash newsgroup/ML. Sorry > for the troll. It's ok. We're a friendly bunch. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/

Re: Migrating from tcsh to bash (issues)

2009-02-04 Thread Stephane CHAZELAS
2009-02-3, 22:07(+00), Simos: > On Tue, Feb 3, 2009 at 9:24 PM, Stephane CHAZELAS > wrote: >> 2009-02-3, 19:38(+00), Simos: >> [...] >>> I have been using tcsh for a long time and I plan to move to bash. >> [...] >> >> I'd recommend moving to zsh instead. The transition is easier >> from tcsh and

mapfile usage

2009-02-04 Thread Alex Reed
Can someone please explain how 'mapfile' should be used? I am trying: cat file.txt | mapfile for i in ${MAPFILE};do echo $i; done and I see no output. I've tried adding the -t option to strip trailing newlines. If I use the following command: mapfile -u file.txt I get the error: bash: mapfi