Re: -e does not work with subscript

2008-01-28 Thread Pierre Gaston
On Jan 29, 2008 9:32 AM, 龙海涛 <[EMAIL PROTECTED]> wrote: > > > $ bash -ce '(false;echo foo);echo bar' > > bar > could i ask what the command line option '-e' mean? > i did not find any explanation in bash's manual. It has the same effect as set -e, you can pass the options of set to bash directly b

Re: capturing sub-expressions?

2008-01-28 Thread Pierre Gaston
On Jan 28, 2008 4:00 AM, Linda Walsh <[EMAIL PROTECTED]> wrote: > I was wondering -- in the bash substitute commands ${..%%|##|//} etc, > is there a way to "capture" a subexpression, so that I can > use the subexpression in the replacement string so I can > end up 'only' with the the subexpression?

Re: -e does not work with subscript

2008-01-28 Thread Pierre Gaston
On Jan 28, 2008 11:36 PM, <[EMAIL PROTECTED]> wrote: > 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'

Re: Is there a Windows native port of Bash or Bourne Shell(no cygwin)?

2008-01-28 Thread Chen(陈) Jun(军)
On 1/28/08, Eric Blake <[EMAIL PROTECTED]> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > According to Chen (陈) Jun (军) on 1/27/2008 11:01 PM: > | Hi, everyone, > | > | I'm new to this list. I'd like to ask is there a Windows native port of > | Bash or Bourne Shell? > > Yes. Search

Re: bash 2.05b.0(1)-release on Debian Sarge: [A-Z]* expands as [A-Za-z]* :-(

2008-01-28 Thread Bob Proulx
Eric Blake wrote: > According Alan Mackenzie: > | % ls [A-Z]* > | . Sadly, ls ignores my intentions and undiscerningly prints a list of > | all files whose names begin with a letter, big or small. > > Actually, it follows your (unintended) directions, thanks to your current > locale, which does a

-e does not work with subscript

2008-01-28 Thread yozh
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='ba

Re: bash 2.05b.0(1)-release on Debian Sarge: [A-Z]* expands as [A-Za-z]* :-(

2008-01-28 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Alan Mackenzie on 1/28/2008 1:58 PM: | | . Sadly, ls ignores my intentions and undiscerningly prints a list of | all files whose names begin with a letter, big or small. Actually, it follows your (unintended) directions, thanks to your

-e does not work properly with subscript

2008-01-28 Thread yozh
Configuration Information [Automatically generated, do not change]: Machine: i386 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='ba

bash 2.05b.0(1)-release on Debian Sarge: [A-Z]* expands as [A-Za-z]* :-(

2008-01-28 Thread Alan Mackenzie
Hi, bash! Sometimes, (like in a source directory), I want to ls files whose name begins with a capital letter, and so do this: % ls [A-Z]* . Sadly, ls ignores my intentions and undiscerningly prints a list of all files whose names begin with a letter, big or small. Yes, I've read the fine manu

Re: capturing sub-expressions?

2008-01-28 Thread Bernd Eggink
Linda Walsh schrieb: I was wondering -- in the bash substitute commands ${..%%|##|//} etc, is there a way to "capture" a subexpression, so that I can use the subexpression in the replacement string so I can end up 'only' with the the subexpression? If the full expression was in a shellvar "Optio

Re: Is there a Windows native port of Bash or Bourne Shell(no cygwin)?

2008-01-28 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Chen (陈) Jun (军) on 1/27/2008 11:01 PM: | Hi, everyone, | | I'm new to this list. I'd like to ask is there a Windows native port of | Bash or Bourne Shell? Yes. Search for the MSYS project (layered on top of mingw). If it doesn't work

Re: Exit application with two function calls

2008-01-28 Thread Linda Walsh
Dang---you're right of course. Didn't test the error case...too used to perl. That's why I drag myself through shell scripts trying to do things I might be tempted to do in perl...*sigh* probably have to resort to a else block, running "Error", then returning the status, i.e.: --- else

Re: Exit application with two function calls

2008-01-28 Thread Andreas Schwab
Linda Walsh <[EMAIL PROTECTED]> writes: > Check_file () > { > if [[ -d "$1" ]]; then echo "$1" # *4 > else return Error "invalid directory: \"$1\""; fi "return" expects a number, not the string "Error" as the first argument and does not take any further argum