'kill -l' outputs SIG prefix if job control not compiled in

2016-11-04 Thread Martijn Dekker
Normal bash: $ kill -l 141 PIPE Bash compiled with --enable-minimal-config --enable-alias: $ kill -l 141 SIGPIPE That SIG prefix shouldn't be there. (Enabling POSIX mode makes no difference to the output.) A look at the source tells me that, for some reason, the POSIXly correct output of 'kill

Re: Bug with && in piped functions in minimal-config bash

2016-11-04 Thread Martijn Dekker
Op 04-11-16 om 21:41 schreef Martijn Dekker: > $ fn() { false && echo bug || echo ok; } > $ fn > ok > $ fn > ok > $ fn | cat > ok > $ fn | cat > bug > $ fn | cat > bug > $ (fn) | cat > ok Another datapoint: the result and output is exactly as above

SIGINT kills interactive shell from dot script

2016-11-06 Thread Martijn Dekker
An interactive bash is killed by SIGINT after a command to unset any trap for SIGINT. $ cat >/tmp/dotscript <

Re: SIGINT kills interactive shell from dot script

2016-11-06 Thread Martijn Dekker
Op 06-11-16 om 09:08 schreef Martijn Dekker: > An interactive bash is killed by SIGINT after a command to unset any > trap for SIGINT. ...if executed in a dot script, that is (in case that wasn't clear from the subject line and the code examples). Another datapoint: the same phenomeno

Re: SIGINT kills interactive shell from dot script

2016-11-07 Thread Martijn Dekker
Op 06-11-16 om 16:52 schreef Chet Ramey: > On 11/6/16 4:08 AM, Martijn Dekker wrote: >> An interactive bash is killed by SIGINT after a command to unset any >> trap for SIGINT. >> >> $ cat >/tmp/dotscript <> trap >> trap - INT >> kill -s INT "$$

Re: SIGINT kills interactive shell from dot script

2016-11-08 Thread Martijn Dekker
Op 08-11-16 om 14:38 schreef Chet Ramey: > On 11/7/16 7:54 AM, Martijn Dekker wrote: > >> But it's really helped that bash turns out to have another unique >> behaviour: apparently, bash refuses to ignore SIGINT on interactive >> shells. So, for interactive bash, the

Changelog credit objection

2016-11-08 Thread Martijn Dekker
y; assignments to it are > > just ignored. Suggested by Martijn Dekker > I object to the impression given that I would suggest any such thing. In fact I think ignoring assignments is very bad practice and I recall arguing rat

[BUG] With null IFS, ${1+$*}, ${var-$*}, etc. don't generate fields

2017-02-18 Thread Martijn Dekker
When IFS is null, unquoted $* within an unquoted substitution (e.g. ${1+$*} or ${unset_var-$*}) joins the PPs together into one field, as if either "$*" or the whole substitution were quoted. POSIX says the unquoted substitution is supposed to generate one field for each positional parameter, with

Why two separate option namespaces?

2017-02-26 Thread Martijn Dekker
It is not clear to me why bash has two separate namespaces for long-named shell options, handled by two separate commands. It might make sense if 'set -o' is for POSIX options only and 'shopt' for bash-specific options, but that doesn't apply. I can't figure out a consistent basis for a distinctio

Re: Why two separate option namespaces?

2017-02-27 Thread Martijn Dekker
Op 27-02-17 om 15:32 schreef Chet Ramey: > At the time, there were already some bash-specfic additions to > `set -o' (braceexpand/histexpand/posix), but I wasn't interested in > adding twenty more. But why not? What's the advantage to users in creating a separate category of options, seemingly bas

Re: [BUG] With null IFS, ${1+$*}, ${var-$*}, etc. don't generate fields

2017-02-27 Thread Martijn Dekker
Op 24-02-17 om 21:20 schreef Grisha Levit: > XRAT C.2.5 : Special Parameters [1] specifically addresses the case of > ${unset_var-$*}. The following example is provided: > > set "abc" "def ghi" "jkl" > IFS='' # null > unset var > printf '%s\n' ${var-$*} > > abcdef ghijkl > > ..which seems to co

Re: [BUG] With null IFS, ${1+$*}, ${var-$*}, etc. don't generate fields

2017-03-18 Thread Martijn Dekker
Op 27-02-17 om 21:03 schreef Chet Ramey: > If you think you have a winning argument, initiate a new discussion with > the Austin Group. You might want to dig up the mail archives from > October, 2014 and look at the discussion that preceded interpretation 888. Thanks for the heads-up. I'm finding

Odd LINENO behaviour in 'eval'

2017-03-19 Thread Martijn Dekker
Test script: printf "$LINENO " printf "$LINENO " eval ' printf "$LINENO " printf "$LINENO " printf "$LINENO " ' printf "$LINENO\n" Output on various shells: bash: 1 2 5 6 7 6 (?!) {m,l,pd}ksh: 1 2 0 0 0 6 (?) AT&T ksh88: 1 2 3 3 3 6 AT&T ksh93: 1 2 1

Re: Bug: different behavior between "jobs -l" and "builtin jobs -l"

2017-03-21 Thread Martijn Dekker
Op 21-03-17 om 18:08 schreef Greg Wooledge: > A builtin is always used by preference over an external command of the > same name. You don't need to specify "builtin jobs" to be sure you're > using the builtin. Just use "jobs". > > The only time you need to use the "builtin" command is when you'r

Re: "unset var" pops var off variable stack instead of unsetting it

2017-03-22 Thread Martijn Dekker
Op 21-03-17 om 16:38 schreef Stephane Chazelas: > IOW, the work around I was mentioning earlier (of using "local" > before "unset" to make sure "unset" unsets) doesn't work in that > case. You'd need to use the same work around as for mksh/yash > (call unset in a loop until the variable is really u

Re: [BUG] With null IFS, ${1+$*}, ${var-$*}, etc. don't generate fields

2017-03-24 Thread Martijn Dekker
Op 18-03-17 om 14:40 schreef Martijn Dekker: > Op 27-02-17 om 21:03 schreef Chet Ramey: >> If you think you have a winning argument, initiate a new discussion with >> the Austin Group. You might want to dig up the mail archives from >> October, 2014 and look at the dis

another case from the case corner case casualty case files

2017-04-02 Thread Martijn Dekker
$ x=$'\\a\\b\\c\\\001\\d\\e\\f' $ case $'abc\001def' in $x) echo ok ;; *) echo oops; esac oops $ x=$'\\a\\b\\c\\\002\\d\\e\\f' $ case $'abc\002def' in $x) echo ok ;; *) echo oops; esac ok 'case' can't match an escaped $'\001' character passed from a variable. Any other character from $'\002' up wo

Re: while loop with extdebug + debug trap always returning 1

2017-04-04 Thread Martijn Dekker
Op 04-04-17 om 11:41 schreef nesro: > # run an empty for cycle. we can see from the output that bash ran :, then > # false and stopped to it. which is the right behavior > for (( :; false; )); do :; done This is a syntax error. 'for' takes arithmetic expressions, not shell commands. > # now run t

devel: 'eval' returns 0 upon syntax error

2017-06-18 Thread Martijn Dekker
bash-snap-20170616 $ (eval '(');echo $? bash: eval: line 2: syntax error: unexpected end of file 0 The exit status is 0, but should be 1. As far as I can trace it, this bug seems to have been introduced in bash-20170511 snapshot. - M.

$* in here-document

2025-04-24 Thread Martijn Dekker
Reproducer: IFS=/ set a b c cat

<    1   2