Re: Another mapfile question.

2011-08-06 Thread Maarten Billemont
On 05 Aug 2011, at 16:32, Steven W. Orr wrote: > On 8/5/2011 9:08 AM, Maarten Billemont wrote: >>> IFS= >>> aa=() >>> while read line >>> do >>> aa+=("$line") >>> done< fn >> >> You should really put that IFS= on your 'read', so as not to break the >> default wordsplitting for the rest of you

Re: Another mapfile question.

2011-08-06 Thread Chris F.A. Johnson
On Fri, 5 Aug 2011, Steven W. Orr wrote: One trick that bit me a while back, is that the order of declaring IFS and old_IFS is important. It has to be done in this order: foo() { typeset -r old_IFS="$IFS" # Must come first typeset IFS stuff... } I always use local and don't ch

Re: Another mapfile question.

2011-08-05 Thread Steven W. Orr
On 8/5/2011 9:08 AM, Maarten Billemont wrote: IFS= aa=() while read line do aa+=("$line") done< fn You should really put that IFS= on your 'read', so as not to break the default wordsplitting for the rest of your script: For purposes of giving concise examples on this email list, I wrote

Re: Another mapfile question.

2011-08-05 Thread Maarten Billemont
> IFS= > aa=() > while read line > do > aa+=("$line") > done < fn You should really put that IFS= on your 'read', so as not to break the default wordsplitting for the rest of your script: while IFS= read -r line > vs. > IFS=$'\n' > aa=($(< fn)) Don't leave expansions unquoted! you're still p