Re: Empty trailing fields ignored by read

2013-08-29 Thread DJ Mills
On Thu, Aug 29, 2013 at 2:54 PM, Greg Wooledge wrote: > On Thu, Aug 29, 2013 at 12:57:22PM -0400, DJ Mills wrote: > > On Thu, Aug 29, 2013 at 12:42 PM, DJ Mills > wrote: > > > > > When using a non-default IFS (a default IFS would trim them), a single > > > empty trailing field is ignored for rea

Re: Lack of quotes causes IFS to be ignored for "${arr[*]}" during assignments

2013-08-29 Thread DJ Mills
On Thu, Aug 29, 2013 at 2:38 PM, Dan Douglas wrote: > On Thursday, August 29, 2013 01:03:20 PM DJ Mills wrote: > > $(arr=(foo bar baz); IFS=:; str=${arr[*]}; echo "$str") > > foo bar baz > > $ (arr=(foo bar baz); IFS=:; str="${arr[*]}"; echo "$str") > > foo:bar:baz > > > > Note that the same thin

Re: Empty trailing fields ignored by read

2013-08-29 Thread Greg Wooledge
On Thu, Aug 29, 2013 at 12:57:22PM -0400, DJ Mills wrote: > On Thu, Aug 29, 2013 at 12:42 PM, DJ Mills wrote: > > > When using a non-default IFS (a default IFS would trim them), a single > > empty trailing field is ignored for read -a. > > > > IFS=: read -rd '' -a arr < <(printf %s ':foo:bar:');

Re: Lack of quotes causes IFS to be ignored for "${arr[*]}" during assignments

2013-08-29 Thread Dan Douglas
On Thursday, August 29, 2013 01:03:20 PM DJ Mills wrote: > $(arr=(foo bar baz); IFS=:; str=${arr[*]}; echo "$str") > foo bar baz > $ (arr=(foo bar baz); IFS=:; str="${arr[*]}"; echo "$str") > foo:bar:baz > > Note that the same thing does not occur for "$*": > $ (set -- foo bar baz; IFS=:; str=$*;

Lack of quotes causes IFS to be ignored for "${arr[*]}" during assignments

2013-08-29 Thread DJ Mills
$(arr=(foo bar baz); IFS=:; str=${arr[*]}; echo "$str") foo bar baz $ (arr=(foo bar baz); IFS=:; str="${arr[*]}"; echo "$str") foo:bar:baz Note that the same thing does not occur for "$*": $ (set -- foo bar baz; IFS=:; str=$*; echo "$str") foo:bar:baz $ (set -- foo bar baz; IFS=:; str="$*"; echo "

Re: Empty trailing fields ignored by read

2013-08-29 Thread DJ Mills
On Thu, Aug 29, 2013 at 12:42 PM, DJ Mills wrote: > When using a non-default IFS (a default IFS would trim them), a single > empty trailing field is ignored for read -a. > > IFS=: read -rd '' -a arr < <(printf %s ':foo:bar:'); printf '<%s> ' > "${arr[@]}"; echo > <> > > I would expect the outpu

Empty trailing fields ignored by read

2013-08-29 Thread DJ Mills
When using a non-default IFS (a default IFS would trim them), a single empty trailing field is ignored for read -a. IFS=: read -rd '' -a arr < <(printf %s ':foo:bar:'); printf '<%s> ' "${arr[@]}"; echo <> I would expect the output to be: <> <>

Re: feature request: file_not_found_handle()

2013-08-29 Thread Aharon Robbins
Hi. > Date: Tue, 20 Aug 2013 11:02:24 -0400 > From: Greg Wooledge > To: Aharon Robbins > Cc: bug-bash@gnu.org > Subject: Re: feature request: file_not_found_handle() > > On Tue, Aug 20, 2013 at 05:48:12PM +0300, Aharon Robbins wrote: > > In article you write: > > >1) PATH is used by the kernel