bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: errexit lost in command substitution


From: Stephane Chazelas
Subject: Re: errexit lost in command substitution
Date: Tue, 11 Jan 2005 16:16:01 +0000
User-agent: Mutt/1.5.6i

On Tue, Jan 11, 2005 at 10:52:16AM -0500, Chet Ramey wrote:
[...]
> > Is it the only changing?
> 
> What does that mean?

I meant, "implicit changing in the option settings when entering
command substitution.

> > saved_options=$(
> >   set +o
> >   shopt -p
> > )
> > [[ -o errexit ]] && saved_options="
> > $saved_options
> > set -o errexit"
> > 
> > Can I assume that to correctly backup the current option
> > setting?
> 
> Looks right.

Thanks. That answers my question.

> > While I'm at it, it seems that the --wordexp option is not
> > documented.
> 
> True.  It's useless unless you have a C library that uses bash to implement
> wordexp(), which is why it's undocumented.
[...]

But it is listed in bash --help, so one may wonder what it is
for.

Note that the interface doesn't seem to take into account that
NL is a valid char in an argument:

$ bash --wordexp $'"A\nB" C'
2
4
A
B
C
$ bash --wordexp $'A "B\nC"'
2
4
A
B
C

Shouldn't it output the words NUL terminated or with an index of
word positions?

-- 
St├ęphane





reply via email to

[Prev in Thread] Current Thread [Next in Thread]