Re: ${//}: say how to non-destructively prefix/suffix

2006-11-05 Thread John Gatewood Ham
You can do this without external programs or pipes. See the attachment. JGH On Mon, 6 Nov 2006, Dan Jacobson wrote: Regarding the ${parameter/pattern/string} ${parameter//pattern/string} discussion on the man page: You don't mention what if pattern is null. Seems that will never ma

3.2.3 regex vs. 3.1.x regex

2006-10-31 Thread John Gatewood Ham
I have attached an example program that can deal with the different regex parsing in 3.0.x vs. 3.1.x and regex sub-expressions. I have tested with 3.1.17 and 3.2.3 successfully. Since creating a script that actually worked with both bash versions took me a while, I suspect other people might wan

Re: bash 3.2 match operator problem

2006-10-12 Thread John Gatewood Ham
Ok, so at least I'm not crazy; there is some kind of bug. When you have a patch I'm eager to help test it. Thank you, JGH On Thu, 12 Oct 2006, Chet Ramey wrote: Ok, here is a smaller 3 line test case. I have attempted to handle the parenthesis as you instructed. Under bash 3.0.17 BASH_REMAT

Re: bash 3.2 match operator problem

2006-10-12 Thread John Gatewood Ham
1.tgz =~ \([^-]+\)-\([^-]+\)-\([^-]+\)-0*\([1-9][0-9]*\)\.tgz ]] set | grep BASH_REMATCH On Thu, 12 Oct 2006, Andreas Schwab wrote: John Gatewood Ham <[EMAIL PROTECTED]> writes: Thank you for your reply. I removed the quotes and the script crashes. There must be more required to conv

Re: bash 3.2 match operator problem

2006-10-12 Thread John Gatewood Ham
Thank you for your reply. I removed the quotes and the script crashes. There must be more required to convert my code and I hope someone will help. It is only 1 line, and once I know the new rules I can convert everything else on my own. I get this when just removing teh quotes on the right ha

bash 3.2 match operator problem

2006-10-11 Thread John Gatewood Ham
Configuration Information [Automatically generated, do not change]: Machine: i586 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i586' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i586-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='b

trap documentation does not match trap behavior

2006-05-10 Thread John Gatewood Ham
Configuration Information [Automatically generated, do not change]: Machine: i586 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i586' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i586-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='b