Re: !* goofs here-strings

2006-07-27 Thread mwoehlke
[EMAIL PROTECTED] wrote: Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: x86_64-pc-linux-gnu-gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VEND

Re: !* goofs here-strings

2006-07-27 Thread mwoehlke
Paul Jarc wrote: mwoehlke <[EMAIL PROTECTED]> wrote: I thought the syntax was only two '<'s? "<<" gives you a here-document. "<<<" gives you a here-string. Check the man page for details. Ah, ok, never noticed that feature before. Huh

Re: null command and parameter expansion for "Display error if null or unset"

2006-07-31 Thread mwoehlke
Poor Yorick wrote: The following line does not perform the "echo" command. : ${FAKEVAR?} || echo hello This seems inconsistent, since the return status is set to one, not to mention that the null command is documented to return a zero exit code. It would be a convenient and concise syntax for

Re: Link Error bash-3.1, AIX 5.2, xlC version 8

2006-08-02 Thread mwoehlke
Perry Smith wrote: This may be a dup but the subject pretty much says it all. Compiled bash-3.1 fresh out of the box with just a configure command. The only error was this: ld: 0711-317 ERROR: Undefined symbol: .isnan I fixed it by adding -lm to the LOCAL_LIBS in the Makefile. Not sure if

Re: Bug with 'test' built-in.

2006-08-10 Thread mwoehlke
John Wenker wrote: Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H

Re: Bug with 'test' built-in.

2006-08-10 Thread mwoehlke
Paul Jarc wrote: John Wenker <[EMAIL PROTECTED]> wrote: The following construct _always_ evaluates true, regardless of whether the file exists or not. if [ ! -a file ]; then echo "This line always prints no matter what." else echo "This line

Re: Bug with 'test' built-in.

2006-08-10 Thread mwoehlke
Paul Jarc wrote: mwoehlke <[EMAIL PROTECTED]> wrote: I *know* '! [ -a file ]' is not portable. I tried to use it in some script, somewhere, at some time, and it was sometimes treated as history expansion. Quoting the "!" would take care of that particular problem

Re: Espace characters need -e, wrong behaviour

2006-08-21 Thread mwoehlke
Nico Schottelius wrote: Bash needs -e to react on escape characters. No other shell (afaik) does that (confirmed with dash, ksh and zsh), nor does posix specify that behaviour: http://www.opengroup.org/onlinepubs/009695399/utilities/echo.html

...Limitation?

2006-09-26 Thread mwoehlke
Not really a bug, but this seems to be the only bash list gname knows about, so... I am trying to figure out how to run a command and pipe the output through tee, and then check the status of the original command. Normally I am a very competent shell programmer, but this one has me stumped!

Re: ...Limitation?

2006-09-26 Thread mwoehlke
Paul Jarc wrote: mwoehlke <[EMAIL PROTECTED]> wrote: I am trying to figure out how to run a command and pipe the output through tee, and then check the status of the original command. This uses a bash-specific feature: cmd > >(tee file); status=$? Thanks Paul and Stephen for th

Re: Fatal bug with redirection

2006-10-04 Thread mwoehlke
Yang wrote: On my FC5 box, when I try certain things in bash 3.1.7(1)-release involving redirection, such as the following, bash crashes (immediately exits): { echo a >&3 ; } 3> >( echo b ) That toasts "3.00.15(1)-release" (FC4 IIRC), but not 3.1.17. I would apply patches 8-17 and try again.

Re: Curly braces expansion not always works as expected.

2006-10-06 Thread mwoehlke
Stephane Chazelas wrote: On Thu, Oct 05, 2006 at 12:23:41AM +0200, Reuti wrote: [...] Curly braces expansion only works with at least one comma (,). This also works, if the appears at least once inside some apostrophes and has no function. Repeat-By: [EMAIL PROTECTED]:

Re: Curly braces expansion not always works as expected.

2006-10-06 Thread mwoehlke
Andreas Schwab wrote: mwoehlke <[EMAIL PROTECTED]> writes: ...but doesn't that mean that '{"x,x"}' should expand as '{x,x}' It does. Huh? $ echo {"x,x"} # expected result: '{x,x}' x,x $ echo $BASH_VERSION 3.1.17(3)-releas

Re: Curly braces expansion not always works as expected.

2006-10-06 Thread mwoehlke
Andreas Schwab wrote: mwoehlke <[EMAIL PROTECTED]> writes: Andreas Schwab wrote: mwoehlke <[EMAIL PROTECTED]> writes: ...but doesn't that mean that '{"x,x"}' should expand as '{x,x}' It does. Huh? In the forthcoming 3.2 release anyway, so t

How to detect bash?

2006-10-10 Thread mwoehlke
Anyone have any clever, VERY reliable tricks for detecting if the current shell is bash? The obvious way is '[ -n "$BASH" ]', but in the interest of catching idiots that set BASH to get around such a check, I came up with: [ "`BASH_SUBSHELL=975 ; ( echo $BASH_SUBSHELL )`" -eq 976 ] (975 is of

Re: How to detect bash?

2006-10-10 Thread mwoehlke
Dave Rutherford wrote: On 10/10/06, mwoehlke <[EMAIL PROTECTED]> wrote: Anyone have any clever, VERY reliable tricks for detecting if the current shell is bash? Well, I don't know if it's clever, but how about: Oh, my... Where do I *start*? $ if [ "${SHELL//*/bash}&q

Re: How to detect bash?

2006-10-10 Thread mwoehlke
Stephane Chazelas wrote: On Tue, Oct 10, 2006 at 05:12:07PM -0500, mwoehlke wrote: Dave Rutherford wrote: On 10/10/06, mwoehlke <[EMAIL PROTECTED]> wrote: Anyone have any clever, VERY reliable tricks for detecting if the current shell is bash? Well, I don't know if it's cleve

Re: How to detect bash?

2006-10-10 Thread mwoehlke
Dave Rutherford wrote: On 10/10/06, mwoehlke <[EMAIL PROTECTED]> wrote: Completely non-workable. That only works if the bash I want is in /bin/bash Well, no. It works as long as the last thing in the path is 'bash'. It could be /usr/bin/bash, /home/bin/bash, or yes, /bin/ba

Re: How to detect bash?

2006-10-11 Thread mwoehlke
Stephane Chazelas wrote: On Tue, Oct 10, 2006 at 06:14:22PM -0500, mwoehlke wrote: [...] $ zsh -c 'echo "`/dev/null 2>&1`"' bash bash: /dev/null: Permission denied $ zsh $ ARGV0=bash ash -c 'echo "`/dev/null 2>&1`"; echo $BASH' bash: /d

Re: How to detect bash?

2006-10-11 Thread mwoehlke
Paul Jarc wrote: mwoehlke <[EMAIL PROTECTED]> wrote: And since when does '#! /bin/bash' mean "use whatever 'bash' you find in $PATH"? Silly me, I thought it meant "use '/bin/bash'". Dave did say "hash-bang", but he didn

Re: How to detect bash?

2006-10-11 Thread mwoehlke
(Sorry for the double-post, I saw your CC and replied privately before I noticed that you did in fact send to the list also.) Ramprasad wrote: On Wed, 2006-10-11 at 02:38, mwoehlke wrote: Anyone have any clever, VERY reliable tricks for detecting if the current shell is bash? Hope, i

Re: builtin time

2006-10-11 Thread mwoehlke
Gabor Mayer wrote: GNU bash, version 3.1.17(1)-release (x86_64-pc-linux-gnu) # builtin time bash: builtin: time: not a shell builtin $ type time time is a shell keyword I don't think this is a bug, even though it feels like one. :-) 'time' is a keyword like 'if', 'for', 'do', 'function', etc.