[bash 3.1.5] sh -c "echo -n ok" broken

2006-01-18 Thread Jeff Chua
GNU bash, version 3.1.5(1)-release sh -c "echo -n ok" returns "-n ok". This breaks a lot of scripts ... startup scripts in /etc/rc.d and many packages like glibc "make check" that use "sh" instead of "bash" with "-n" option. How can I make sh -c "echo -n ok" returns "ok" instead "-n ok"? I

Re: [bash 3.1.5] sh -c "echo -n ok" broken

2006-01-18 Thread Jeff Chua
On Wed, 18 Jan 2006, Chet Ramey wrote: Somehow you've enabled the xpg_echo option, either by configuring with --enable-xpg-echo-default or running `shopt -s xpg_echo' somewhere. I suspect the former. Yes, I did "--enable-xpg-echo-default" as I need echo "ok\c" to work. The older bash-3.00.15

Re: Bash-3.1 Official patch 10

2006-02-24 Thread Jeff Chua
On Wed, 22 Feb 2006, Greg Schafer wrote: status=`echo '-'| { ${GREP} -E -e 'a\' >/dev/null 2>&1 ; echo $?; }` You're having one additional "\" ... change that to ... status=`echo '-'| { ${GREP} -E -e 'a' >/dev/null 2>&1 ; echo $?; }` or split to the next line ... status=`echo '-'| {

bash=~ bug or feature

2007-05-17 Thread Jeff Chua
With bash 3.1.17(4)-release # [[ "abcd" =~ "^a" ]]; echo $? 0 With bash 3.2.17(3)-release # [[ "abcd" =~ "^a" ]]; echo $? # is this a bug??? 1 # [[ "abcd" =~ ^a ]]; echo $? 0 Is this a bug? Thanks, Jeff. ___ Bug-bash mailing list Bug-bash@gnu

Re: bash=~ bug or feature

2007-05-18 Thread Jeff Chua
On Thu, 17 May 2007, Bob Proulx wrote: The behavior has been intentionally changed. Please see Bash FAQ item E14. Ok, thanks. I should have read the FAQ first. Thanks, Jeff. ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailm

[PATCH] silent job monitor when 'set +m'

2009-11-07 Thread Jeff Chua
Chet, The man page mentioned that 'set -m' should print 'a line containing their status upon their completion' ... which should imply 'set +m' should NOT print the status. Attached is a patch to 'silent' bash so that it won't print the status when 'Monitor mode' is off (set +m). If this i

Re: [PATCH] silent job monitor when 'set +m'

2009-11-07 Thread Jeff Chua
On Sat, Nov 7, 2009 at 8:12 PM, Jan Schampera wrote: > A workaround is to diswon the monster. But yes, I also stumbled over > this once. See > http://bash-hackers.org/wiki/doku.php/snipplets/kill_bg_job_without_message > "disown"... that's new to me. Nice. At least it's an alternative to "set +m

Re: [PATCH] silent job monitor when 'set +m'

2009-11-07 Thread Jeff Chua
On Sun, Nov 8, 2009 at 5:25 AM, Chet Ramey wrote: > > Are you saying you ran a script in which you enabled job > control, ran a job, turned job control off, then killed the job? > No, I didn't turn off job control. I use "set +m" to turn of monitoring only because I don't want to see any message

Re: [PATCH] silent job monitor when 'set +m'

2009-11-08 Thread Jeff Chua
On Sun, Nov 8, 2009 at 10:14 AM, Chet Ramey wrote: > I think you're confused about the distinction. set -m and +m turn job > control on and off. The `monitor' name is historical (ask Dave Korn > why he chose it). > That's what confused the whole issue. > What version of bash are you using?

Re: [PATCH] silent job monitor when 'set +m'

2009-11-08 Thread Jeff Chua
> On Sun, Nov 8, 2009 at 5:25 AM, Chet Ramey wrote: > non-interactive shells don't have job control enabled by default. Are you saying > you ran a script in which you enabled job control, ran a job, turned job control off, > then killed the job? > Bash and historical versions of sh report the

Re: [PATCH] silent job monitor when 'set +m'

2009-11-09 Thread Jeff Chua
On Mon, Nov 9, 2009 at 10:42 AM, Chet Ramey wrote: > Sure. Since the status messages are written to stderr, you can save > file descriptor 2 and temporarily (or permanently, depending on your > needs) redirect it to /dev/null. > That means another subshell. Thanks for all your help. Jeff.

Re: [PATCH] silent job monitor when 'set +m'

2009-11-10 Thread Jeff Chua
On Tue, Nov 10, 2009 at 6:20 AM, Jan Schampera wrote: > Chet Ramey schrieb: > > > redirect stderr > > kill pid > > wait pid > > restore stderr > > > > It seems to me that this sequence forces the necessary synchronicity. > > Interesting. And sad that I never thought of that > Will you consider h

Re: [PATCH] silent job monitor when 'set +m'

2009-11-10 Thread Jeff Chua
On Tue, Nov 10, 2009 at 11:09 PM, Chet Ramey wrote: > Jeff Chua wrote: > > > > > > On Tue, Nov 10, 2009 at 6:20 AM, Jan Schampera > <mailto:jan.schamp...@web.de>> wrote: > > > > Chet Ramey schrieb: > > > > > redirect stderr &g

Re: [PATCH] silent job monitor when 'set +m'

2009-11-10 Thread Jeff Chua
On Wed, Nov 11, 2009 at 12:44 AM, Chet Ramey wrote: > > How do you silent this one without a subshell. > > What's wrong with the approach above? > Nothing wrong, but can be made more efficient because "| grep" means another subprocess which can be eliminated if the shell silents the Terminate co

Re: [PATCH] silent job monitor when 'set +m'

2009-11-10 Thread Jeff Chua
On Wed, Nov 11, 2009 at 12:04 PM, Jeff Chua wrote: > > > On Wed, Nov 11, 2009 at 12:44 AM, Chet Ramey wrote: > >> > How do you silent this one without a subshell. >> >> What's wrong with the approach above? >> > > Nothing wrong, but can be ma