Re: builtin "read -d" behaves differently after "set -e#

2013-02-06 Thread Greg Wooledge
On Wed, Feb 06, 2013 at 12:39:45AM +0100, Tiwo W. wrote: > When using this in a script of mine, I noticed that this fails > when errexit is set ("set -e"). Most things do. set -e is crap. You should consider not using it. > * why does it work with "set +e" ? Because set

When cd'd into a symlinked directory, directory completion can sometimes erroneously parse ../

2013-02-06 Thread i336
Do: mkdir cd mkdir -p dir1/dir2 ln -s dir1/dir2 ouch touch idontexist ls # ^ to see dir & files & prove they really exist :P cd ouch ls ../ido ... :P I can see why this exists... this is a complex one to solve. *leaves it to you to figure it out* xD -i336

Re: When cd'd into a symlinked directory, directory completion can sometimes erroneously parse ../

2013-02-06 Thread Chet Ramey
On 2/5/13 10:23 PM, i336 wrote: > Do: > > mkdir > cd > mkdir -p dir1/dir2 > ln -s dir1/dir2 ouch > touch idontexist > ls # ^ to see dir & files & prove they really exist :P > cd ouch > ls ../ido > > ... Filename completion uses whatever file system view -- logical or physical -- that you have

Re: builtin "read -d" behaves differently after "set -e#

2013-02-06 Thread John Kearney
Am 06.02.2013 14:46, schrieb Greg Wooledge: > On Wed, Feb 06, 2013 at 12:39:45AM +0100, Tiwo W. wrote: >> When using this in a script of mine, I noticed that this fails >> when errexit is set ("set -e"). > Most things do. set -e is crap. You should consider not using it. > >>

Re: builtin "read -d" behaves differently after "set -e#

2013-02-06 Thread Greg Wooledge
On Wed, Feb 06, 2013 at 07:12:01PM +0100, John Kearney wrote: > IFS= read -rd '' var2 < > should work. Which is essentially equivalent to doing "set +e" before, and "set -e" again right after. In either case, you're temporarily working around the brokenness of set -e for a single command.

Re: builtin "read -d" behaves differently after "set -e#

2013-02-06 Thread DJ Mills
On Tue, Feb 5, 2013 at 6:39 PM, Tiwo W. wrote: > I have seen "read -d '' var" to read multi-line heredocs into > shell variables. An empty argument to -d seemed to mean "read > up to the end of input". And this is what it does. > > In addition to all of the "don't use set

Re: builtin "read -d" behaves differently after "set -e#

2013-02-06 Thread Dan Douglas
On Wednesday, February 06, 2013 01:44:04 PM DJ Mills wrote: > On Tue, Feb 5, 2013 at 6:39 PM, Tiwo W. wrote: > > > I have seen "read -d '' var" to read multi-line heredocs into > > shell variables. An empty argument to -d seemed to mean "read > > up to the end of input". A

Re: When cd'd into a symlinked directory, directory completion can sometimes erroneously parse ../

2013-02-06 Thread Bob Proulx
Chet Ramey wrote: > i336 wrote: > > mkdir -p dir1/dir2 > > ln -s dir1/dir2 ouch > > touch idontexist > > ls # ^ to see dir & files & prove they really exist :P > > cd ouch > > ls ../ido > > ... > > Filename completion uses whatever file system view -- logical or physical > -- that you have selecte