Re: Compiling Bash 2.05b (patched) gives error: label at end of compound statement [solved]

2010-11-22 Thread Dennis Williamson
Some systems still use older versions. It's useful to be able to have access to them when working away from the target system. On Mon, Nov 22, 2010 at 7:56 PM, Clark J. Wang wrote: > On Tue, Nov 23, 2010 at 1:33 AM, Dennis Williamson > wrote: >> >> Compiling Bash 2.05b with seven patches applied

Re: bash: Correct usage of F_SETFD

2010-11-22 Thread Sukadev Bhattiprolu
Eric Blake [ebl...@redhat.com] wrote: | On 11/22/2010 03:16 PM, Chet Ramey wrote: | >> include/filecntl.h in bash-4.1 has following: | >> | >> #define SET_CLOSE_ON_EXEC(fd) (fcntl ((fd), F_SETFD, FD_CLOEXEC)) | >> | >> Is that really the correct/intended usage of F_SETFD ? | > | > F_SETFD

Re: ionice bash pid in bash_profile Fails

2010-11-22 Thread Roger
On Mon, Nov 22, 2010 at 04:58:46PM -0500, Greg Wooledge wrote: >On Mon, Nov 22, 2010 at 12:44:54PM -0900, Roger wrote: >> ionice -c 2 -n 0 -p `echo $$` > >You don't need echo or `` here. > >ionice -c 2 -n 0 -p $$ Just so used to using quotes in bash, just assumed. Thanks. -- Roger http://rogerx

Re: bash: Correct usage of F_SETFD

2010-11-22 Thread Eric Blake
On 11/22/2010 03:16 PM, Chet Ramey wrote: >> include/filecntl.h in bash-4.1 has following: >> >> #define SET_CLOSE_ON_EXEC(fd) (fcntl ((fd), F_SETFD, FD_CLOEXEC)) >> >> Is that really the correct/intended usage of F_SETFD ? > > F_SETFDSet the close-on-exec flag associated with fi

Re: blink-matching-paren doesn't blink

2010-11-22 Thread Chet Ramey
On 11/22/10 5:24 PM, Dennis Williamson wrote: > In Bash 4.1 downloaded and patched from the case.edu Bash site, when I > do bind -v I see "set blink-matching-paren on" (and have non-working > paren matching) without having changed any compile-time settings and > with no corresponding command in any

Re: blink-matching-paren doesn't blink

2010-11-22 Thread Dennis Williamson
In Bash 4.1 downloaded and patched from the case.edu Bash site, when I do bind -v I see "set blink-matching-paren on" (and have non-working paren matching) without having changed any compile-time settings and with no corresponding command in any startup files. So I don't know how it got (half) ena

Re: ionice bash pid in bash_profile Fails

2010-11-22 Thread Bob Proulx
Roger wrote: > # See ionice manfile - give high priority to Bash > ionice -c 2 -n 0 -p `echo $$` You don't need to use backticks to echo out the value of $$. Just use it directly. ionice -c 2 -n 0 -p $$ Bob

Re: bash: Correct usage of F_SETFD

2010-11-22 Thread Chet Ramey
> include/filecntl.h in bash-4.1 has following: > > #define SET_CLOSE_ON_EXEC(fd) (fcntl ((fd), F_SETFD, FD_CLOEXEC)) > > Is that really the correct/intended usage of F_SETFD ? F_SETFDSet the close-on-exec flag associated with fildes to the low order bit

Re: ionice bash pid in bash_profile Fails

2010-11-22 Thread Chris F.A. Johnson
On Mon, 22 Nov 2010, Roger wrote: On Mon, Nov 22, 2010 at 11:58:25AM -0500, Greg Wooledge wrote: On Mon, Nov 22, 2010 at 07:41:48AM -0900, Roger wrote: On Mon, Nov 22, 2010 at 08:39:49AM -0500, Greg Wooledge wrote: ionice -c 2 -n 0 -p `pidof bash` If you want the PID of the current shell p

Re: ionice bash pid in bash_profile Fails

2010-11-22 Thread Greg Wooledge
On Mon, Nov 22, 2010 at 12:44:54PM -0900, Roger wrote: > ionice -c 2 -n 0 -p `echo $$` You don't need echo or `` here. ionice -c 2 -n 0 -p $$

Re: ionice bash pid in bash_profile Fails

2010-11-22 Thread Roger
On Mon, Nov 22, 2010 at 11:58:25AM -0500, Greg Wooledge wrote: >On Mon, Nov 22, 2010 at 07:41:48AM -0900, Roger wrote: >> On Mon, Nov 22, 2010 at 08:39:49AM -0500, Greg Wooledge wrote: >> >> ionice -c 2 -n 0 -p `pidof bash` >> >If you want the PID of the current shell process, use $$ instead. >>

bash: Correct usage of F_SETFD

2010-11-22 Thread Sukadev Bhattiprolu
include/filecntl.h in bash-4.1 has following: #define SET_CLOSE_ON_EXEC(fd) (fcntl ((fd), F_SETFD, FD_CLOEXEC)) Is that really the correct/intended usage of F_SETFD ? If kernel ever adds a new flag to the fd, this would end up clearing the other new flag right ? Shouldn't bash use F_GETFD to

Re: blink-matching-paren doesn't blink

2010-11-22 Thread Chet Ramey
On 11/22/10 3:36 PM, Dennis Williamson wrote: > When I do > > bind -v > > one of the settings I see is > > set blink-matching-paren on It's not supposed to be enabled by default. (It's also not documented.) Since a function has to run to do the appropriate things when it's enabled, and isn't r

blink-matching-paren doesn't blink

2010-11-22 Thread Dennis Williamson
When I do bind -v one of the settings I see is set blink-matching-paren on but I don't get any blinking when I type closing parentheses at the command line. If I do bind 'set blink-matching-paren on' or have set blink-matching-paren on in my ~/.inputrc explicitly, then it works. Why does

Compiling Bash 2.05b (patched) gives error: label at end of compound statement [solved]

2010-11-22 Thread Dennis Williamson
Compiling Bash 2.05b with seven patches applied. malloc.c: In function ‘internal_free’: malloc.c:881: error: label at end of compound statement make[1]: *** [malloc.o] Error 1 Adding a semicolon on the line after this label satisfies the picky gcc 4.4.1 (actually since 3.4?). This is just FYI fo

Re: ionice bash pid in bash_profile Fails

2010-11-22 Thread Greg Wooledge
On Mon, Nov 22, 2010 at 07:41:48AM -0900, Roger wrote: > On Mon, Nov 22, 2010 at 08:39:49AM -0500, Greg Wooledge wrote: > >> ionice -c 2 -n 0 -p `pidof bash` > >If you want the PID of the current shell process, use $$ instead. > > Here's the error I get when logging into a virtual terminal and >

Re: ionice bash pid in bash_profile Fails

2010-11-22 Thread Jan Schampera
Roger wrote: If you want the PID of the current shell process, use $$ instead. Yes I do. It's only me on this computer, unless you're speculating on prioritizing a snooper. :-O This is (in this context) not related to the number pf "bash" processes running. Not at all. -- Be conservative

Re: ionice bash pid in bash_profile Fails

2010-11-22 Thread Roger
On Mon, Nov 22, 2010 at 08:39:49AM -0500, Greg Wooledge wrote: >On Sun, Nov 21, 2010 at 04:08:33PM -0900, Roger wrote: >> When logging in, the following fails if put in $HOME/.bash_profile: >> >> ionice -c 2 -n 0 -p `pidof bash` >> >> ... I'm guessing, because bash hasn't started yet? > >I very

Re: BUG: echo builtin does not handle -- arguments

2010-11-22 Thread Chet Ramey
On 11/22/10 3:33 AM, Марк Коренберг wrote: > It will be nice if I cat write > echo -- "$i" > as many tool, such as grep, use. Posix specifically says that echo does not honor `--'. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hip

Re: ionice bash pid in bash_profile Fails

2010-11-22 Thread Greg Wooledge
On Sun, Nov 21, 2010 at 04:08:33PM -0900, Roger wrote: > When logging in, the following fails if put in $HOME/.bash_profile: > > ionice -c 2 -n 0 -p `pidof bash` > > ... I'm guessing, because bash hasn't started yet? I very much doubt you want to use `pidof bash` here. That would pick up EVER

Re: BUG: echo builtin does not handle -- arguments

2010-11-22 Thread Pierre Gaston
On Mon, Nov 22, 2010 at 10:33 AM, Марк Коренберг wrote: > in latest bash: > > suppose script: > > for i in "${filenam...@]}"; do >    echo "$i" > done > > if malicious user give file name "-e", empty string will be emitted to > stdout, but string "-e" should. > > It will be nice if I cat write > e

BUG: echo builtin does not handle -- arguments

2010-11-22 Thread Марк Коренберг
in latest bash: suppose script: for i in "${filenam...@]}"; do echo "$i" done if malicious user give file name "-e", empty string will be emitted to stdout, but string "-e" should. It will be nice if I cat write echo -- "$i" as many tool, such as grep, use. Now, I replace echo "$i" with pr