Re: exit status issue

2011-11-23 Thread Andreas Schwab
"Steven W. Orr" writes: > I think we're beating this one to death, but I have point out that > telling perl to run a print command whose output is redirected by bash > is not the same as telling bash to run a builtin echo command that is > redirected as an integral operation of the same interpret

Re: exit status issue

2011-11-23 Thread Stefano Lattarini
On Wednesday 23 November 2011, Andreas Schwab wrote: > "Steven W. Orr" writes: > > > I think we're beating this one to death, but I have point out that > > telling perl to run a print command whose output is redirected by bash > > is not the same as telling bash to run a builtin echo command that

set -e works incorrectly in subshells

2011-11-23 Thread Марк Коренберг
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE

Re: set -e works incorrectly in subshells

2011-11-23 Thread Roman Rakus
On 11/23/2011 11:26 AM, Марк Коренберг wrote: Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDO

Re: set -e works incorrectly in subshells

2011-11-23 Thread Eric Blake
On 11/23/2011 03:26 AM, Марк Коренберг wrote: > Repeat-By: > mmarkk@mmarkk-work:~$ ( set -e; echo aaa; false; echo bbb ) > aaa > mmarkk@mmarkk-work:~$ ( set -e; echo aaa; false; echo bbb ) || true > aaa > bbb > mmarkk@mmarkk-work:~$ ksh has the same behavior, an

Re: feature request: printf %(%s)T

2011-11-23 Thread Chet Ramey
On 11/22/11 4:53 PM, Greg Wooledge wrote: > This is a feature request, rather than a bug. Bash 4.2's printf command > has a lovely %(datefmt)T feature that allows it to print out formatted > timestamps using the underlying operating system's strftime(3) routine. > It even allows bash to print the

Re: feature request: printf %(%s)T

2011-11-23 Thread Greg Wooledge
On Wed, Nov 23, 2011 at 12:00:34PM -0500, Chet Ramey wrote: > I wonder if a better way to handle this is to require the %s expansion > at configure time and use the strftime replacement in lib/sh if the C > library's strftime doesn't implement it. What systems, if you know, do > not handle %s? HP

Re: feature request: printf %(%s)T

2011-11-23 Thread Eric Blake
On 11/23/2011 10:11 AM, Greg Wooledge wrote: > On Wed, Nov 23, 2011 at 12:00:34PM -0500, Chet Ramey wrote: >> I wonder if a better way to handle this is to require the %s expansion >> at configure time and use the strftime replacement in lib/sh if the C >> library's strftime doesn't implement it.

Re: feature request: printf %(%s)T

2011-11-23 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/23/11 12:29 PM, Eric Blake wrote: > On 11/23/2011 10:11 AM, Greg Wooledge wrote: >> On Wed, Nov 23, 2011 at 12:00:34PM -0500, Chet Ramey wrote: >>> I wonder if a better way to handle this is to require the %s expansion >>> at configure time and u

Re: exit status issue

2011-11-23 Thread Dallas Clement
Hi All, Just wanted to let you know that I have found a solution to my problem, though I can't entirely explain it yet. As mentioned earlier, this script was designed to run as a daemon, i.e. run in the background. This is what I was doing to daemonize the script: Daemon() { while :

Re: exit status issue

2011-11-23 Thread Greg Wooledge
On Wed, Nov 23, 2011 at 02:09:57PM -0600, Dallas Clement wrote: > trap CleanupExit KILL For the record, you cannot trap SIGKILL.

Re: feature request: printf %(%s)T

2011-11-23 Thread Stephane CHAZELAS
2011-11-23, 12:00(-05), Chet Ramey: > On 11/22/11 4:53 PM, Greg Wooledge wrote: >> This is a feature request, rather than a bug. Bash 4.2's printf command >> has a lovely %(datefmt)T feature that allows it to print out formatted >> timestamps using the underlying operating system's strftime(3) rou

read fails on null-byte: v4.1.7 FreeBSD 8.0 (amd64)

2011-11-23 Thread Matthew Story
Bash Version: GNU bash, version 4.1.7(1)-release (amd64-portbld-freebsd8.0) OS: FreeBSD 8.0 Hardware: amd64 Environment: jail Description: read terminates reading all records at first null-byte ( chr(0) ) in a stream, null-bytes are valid ascii characters and should not cause read

bash process substitution process not awaited before next statement started?

2011-11-23 Thread alexis
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKA

Re: bash process substitution process not awaited before next statement started?

2011-11-23 Thread Greg Wooledge
On Wed, Nov 23, 2011 at 08:41:56AM +0100, ale...@pasta.net wrote: > Description: > It looks as if bash is not waiting for a process-substition process > which is reading stdin to complete before bash moves on to executing > the next statement. Process substitutions are background

Bash-4.2 Official patch 11

2011-11-23 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.2 Patch-ID: bash42-011 Bug-Reported-by:"David Parks" Bug-Reference-ID: <014101cc82c6$46ac1540$d4043fc0$@com> Bug-Reference-URL: http://lists.gnu.org/archive/h

Bash-4.2 Official patch 12

2011-11-23 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.2 Patch-ID: bash42-012 Bug-Reported-by:Rui Santos Bug-Reference-ID: <4e04c6d0.2020...@grupopie.com> Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-b

Bash-4.2 Official patch 13

2011-11-23 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.2 Patch-ID: bash42-013 Bug-Reported-by:Marten Wikstrom Bug-Reference-ID: Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-05/msg00049.html

Bash-4.2 Official patch 14

2011-11-23 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.2 Patch-ID: bash42-014 Bug-Reported-by:Shawn Bohrer Bug-Reference-ID: <20110504152320.6e8f28130...@dev1.rgmadvisors.com> Bug-Reference-URL: http://lists.gnu.o

Bash-4.2 Official patch 15

2011-11-23 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.2 Patch-ID: bash42-015 Bug-Reported-by: Bug-Reference-ID: <728_1312188080_4e3666b0_728_118711_1_3b5d3e0f95cc5c478d6500cdce8b691f74a...@puexcb2b.nanterre.francet

Bash-4.2 Official patch 16

2011-11-23 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.2 Patch-ID: bash42-016 Bug-Reported-by:Martin von Gagern Bug-Reference-ID: <4e43ad9e.8060...@gmx.net> Bug-Reference-URL: http://lists.gnu.org/archive/html/bug

Bash-4.2 Official patch 17

2011-11-23 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.2 Patch-ID: bash42-017 Bug-Reported-by:Curtis Doty Bug-Reference-ID: <20110621035324.a4f70849...@mx1.iparadigms.net> Bug-Reference-URL: http://lists.gnu.org/a

Bash-4.2 Official patch 18

2011-11-23 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.2 Patch-ID: bash42-018 Bug-Reported-by:Thomas Cort Bug-Reference-ID: Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-06/msg00110.html Bug

Bash-4.2 Official patch 19

2011-11-23 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.2 Patch-ID: bash42-019 Bug-Reported-by:Diego Augusto Molina Bug-Reference-ID: Bug-Reference-URL: lists.gnu.org/archive/html/bug-bash/2011-09/msg00047.html

Bash-4.2 Official patch 20

2011-11-23 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 4.2 Patch-ID: bash42-020 Bug-Reported-by:Vincent Sheffer Bug-Reference-ID: Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-readline/2011-08/msg0.

Re: read fails on null-byte: v4.1.7 FreeBSD 8.0 (amd64)

2011-11-23 Thread Greg Wooledge
On Wed, Nov 23, 2011 at 09:03:33AM -0500, Matthew Story wrote: > Description: read terminates reading all records at first null-byte ( chr(0) > ) in a stream, null-bytes are valid ascii characters and should not cause > read to stop reading > a line this behavior is not reproducibl

Re: read fails on null-byte: v4.1.7 FreeBSD 8.0 (amd64)

2011-11-23 Thread Chet Ramey
On 11/23/11 9:03 AM, Matthew Story wrote: > Bash Version: GNU bash, version 4.1.7(1)-release (amd64-portbld-freebsd8.0) > OS: FreeBSD 8.0 > Hardware: amd64 > Environment: jail > Description: read terminates reading all records at first null-byte ( chr(0) > ) in a stream, null-bytes

Re: bash tab variable expansion question?

2011-11-23 Thread Chet Ramey
> On 10/17/11 3:07 PM, Michael Kalisz wrote: > > Hi Chet, > > > > The shopt "direxpand" feature works as advertised (Thanks!) except that I > > noticed it seems to break the name-completion of executables which are not > > in you path. > > Yes, it expands the directory name. In this case, it exp

Re: Bash-4.2 Official patch 12

2011-11-23 Thread Andreas Schwab
--- parse.y +++ parse.y @@ -5983,6 +5983,8 @@ save_input_line_state (ls) /* force reallocation */ shell_input_line = 0; shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; + + return ls; } void Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerp

Re: Bash-4.2 Official patch 12

2011-11-23 Thread Chet Ramey
On 11/23/11 6:51 PM, Andreas Schwab wrote: > --- parse.y > +++ parse.y > @@ -5983,6 +5983,8 @@ save_input_line_state (ls) >/* force reallocation */ >shell_input_line = 0; >shell_input_line_size = shell_input_line_len = shell_input_line_index = 0; > + > + return ls; > } Thanks. The r

Re: read fails on null-byte: v4.1.7 FreeBSD 8.0 (amd64)

2011-11-23 Thread Matthew Story
On Nov 23, 2011, at 4:47 PM, Chet Ramey wrote: > On 11/23/11 9:03 AM, Matthew Story wrote: >> Bash Version: GNU bash, version 4.1.7(1)-release (amd64-portbld-freebsd8.0) >> OS: FreeBSD 8.0 >>Hardware: amd64 >> Environment: jail >> Description: read terminates reading all records at fi

Re: read fails on null-byte: v4.1.7 FreeBSD 8.0 (amd64)

2011-11-23 Thread Chet Ramey
On 11/23/11 6:54 PM, Matthew Story wrote: > On Nov 23, 2011, at 4:47 PM, Chet Ramey wrote: > >> On 11/23/11 9:03 AM, Matthew Story wrote: >>> Bash Version: GNU bash, version 4.1.7(1)-release (amd64-portbld-freebsd8.0) >>> OS: FreeBSD 8.0 >>>Hardware: amd64 >>> Environment: jail >>> De

Re: read fails on null-byte: v4.1.7 FreeBSD 8.0 (amd64)

2011-11-23 Thread Matthew Story
>> Bash doesn't drop NULs like the >> FreeBSD (not the Bourne) shell. one last note on bash dropping NULs: [bash ~]$ foo=`printf 'foo\0bar'` [bash ~]$ echo $foo |od -a 000f o o b a r nl 007 > > FreeBSD sh indeed, apologies for the miss

Re: read fails on null-byte: v4.1.7 FreeBSD 8.0 (amd64)

2011-11-23 Thread Matthew Story
On Nov 23, 2011, at 7:09 PM, Chet Ramey wrote: > On 11/23/11 6:54 PM, Matthew Story wrote: >> On Nov 23, 2011, at 4:47 PM, Chet Ramey wrote: >> >>> On 11/23/11 9:03 AM, Matthew Story wrote: [... snip] > > Yes, sorry. That's what the "bash treats the line read as a C string" > was intended

Bash git repository on savannah

2011-11-23 Thread Chet Ramey
I spent a little while messing around with git over the past couple of days, and ended up updating the bash git repository on savannah (http://git.savannah.gnu.org/cgit/bash.git to browse the sources). Bash-4.2 patch 20 is the head of the tree, and there's a branch containing the `direxpand' patche

Re: read fails on null-byte: v4.1.7 FreeBSD 8.0 (amd64)

2011-11-23 Thread Chet Ramey
On 11/23/11 9:44 PM, Matthew Story wrote: > > On Nov 23, 2011, at 7:09 PM, Chet Ramey wrote: > >> On 11/23/11 6:54 PM, Matthew Story wrote: >>> On Nov 23, 2011, at 4:47 PM, Chet Ramey wrote: >>> On 11/23/11 9:03 AM, Matthew Story wrote: > [... snip] >> >> Yes, sorry. That's what the "ba