Re: coprocess questions (manpage doesn't seem clear)

2011-04-12 Thread Andreas Schwab
Linda Walsh writes: > 1) If Name isn't supplied, where does it put the handles & Pid? "If NAME is not supplied, the default name is COPROC." Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something compl

bash trap ignore signal - race condition

2011-04-12 Thread Roman Rakus
There's a race condition when you can hit following: set_signal_handler (sig, SIG_IGN); change_signal (sig, savestring (string)); set_signal_handler (sig, trap_handler); in trap.c file, set_signal() function. So bash set signal to be ignored and then set it to be handled by trap

Re: bash trap ignore signal - race condition

2011-04-12 Thread Chet Ramey
On 4/12/11 8:33 AM, Roman Rakus wrote: > There's a race condition when you can hit following: > set_signal_handler (sig, SIG_IGN); > change_signal (sig, savestring (string)); > set_signal_handler (sig, trap_handler); > in trap.c file, set_signal() function. > So bash set signal to

Re: coprocess questions (manpage doesn't seem clear)

2011-04-12 Thread Chet Ramey
On 4/11/11 3:52 PM, Linda Walsh wrote: > I was looking @ coprocess section in the manpage where it says that: > > NAME must not be supplied if command is a simple command. > For the coproc: >FH1(stdout) is put in NAME[0] >FH0(stdin) is put in NAME[1] >PID is put in NAME_PID > > Que

Error in the 'help' builtin's documentation of 'wait'

2011-04-12 Thread Pablo Ramella
Configuration Information [Automatically generated, do not change]: Machine: i486 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash

Why is command substitution happening?

2011-04-12 Thread Bill Gradwohl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have a tiny script to prune empty directories from a structure. The essential line is as follows: tree --noreport -dfi "${1}" | tac | sed 's/"/\\"/g;s/^/rmdir - --ignore-fail-on-non-empty "/;s/$/"/'|bash Running it recently produced : bash: comman

Re: Why is command substitution happening?

2011-04-12 Thread Andreas Schwab
Bill Gradwohl writes: > Running it recently produced : > bash: command substitution: line 2201: syntax error near unexpected > token `(' > bash: command substitution: line 2201: `rmdir --ignore-fail-on-non-empty > "/snapshot/Music/Etta James/The Essential Etta James/The Essential Etta > James (Di

Re: Why is command substitution happening?

2011-04-12 Thread Greg Wooledge
On Mon, Apr 11, 2011 at 12:23:15PM -0600, Bill Gradwohl wrote: > -BEGIN PGP SIGNED MESSAGE- > > I have a tiny script to prune empty directories from a structure. The > essential line is as follows: > > tree --noreport -dfi "${1}" | tac | sed 's/"/\\"/g;s/^/rmdir > - --ignore-fail-on-non-e

Re: coprocess questions (manpage doesn't seem clear)

2011-04-12 Thread Linda Walsh
Chet Ramey wrote: The default name is COPROC. --- Hmmm that one is right there...just overlooked due to phrasing and formatting: This creates a coprocess named NAME. If NAME is not supplied, the default name is COPROC. NAME must not be supplied if command is a

Re: Why is command substitution happening?

2011-04-12 Thread Bill Gradwohl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/12/2011 08:01 AM, Andreas Schwab wrote: > > The paren is a red herring, you need to get rid of the backquote. > The backquotes you see in the message were supplied by bash's error reporting. I don't have any back quotes. Removing the "|bash" fr

Re: Why is command substitution happening?

2011-04-12 Thread Bill Gradwohl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/12/2011 08:03 AM, Greg Wooledge wrote: > Not good. You're piping filenames into bash and letting bash parse them > as commands. Not exactly. I'm passing in commands containing file names. >If a filename contains something like $(...) or `...

Re: Why is command substitution happening?

2011-04-12 Thread Greg Wooledge
On Tue, Apr 12, 2011 at 09:15:40AM -0600, Bill Gradwohl wrote: > What I did notice were path names that contained single quotes as > follows scattered throughout the stream: > > rmdir --ignore-fail-on-non-empty "/snapshot/Music/ZZ Top/ZZ Top - ZZ > Top's First Album -1970" > > I also noticed path

Re: unwanted warning "execute_coproc: coproc [$PID:.*] still exists"

2011-04-12 Thread Chet Ramey
On 4/7/11 8:06 AM, sbra...@suse.cz wrote: > Bash Version: 4.1 > Patch Level: 10 > Release Status: release > > Description: > Warning "execute_coproc: coproc [$PID:.*] still exists" as it is > implemented makes no sense. It appears in many situations where > it is done intentiona

Re: bash trap ignore signal - race condition

2011-04-12 Thread Roman Rakus
On 04/12/2011 03:30 PM, Chet Ramey wrote: Probably because it's very old code. That has been there essentially unchanged since at least bash-1.12 -- almost twenty years ago. It would be better to block the signal while the trap string and handler are being modified. Chet Thanks for the answer.

heredocs incorrectly printed in for ((...)) loop

2011-04-12 Thread Mike Frysinger
seems to be just like the bug fixed in bash41-006, but with a diff for loop style. simple example: f() { for (( :; :; )) ; do cat < signature.asc Description: This is a digitally signed message part.