bash 4.2 breaks source finding libs in lib/filename...

2012-02-28 Thread Linda Walsh
I have several files that source the lib files by expecting the name of the lib to be checked against PATH -- but this no longer works when the library is in lib/filename. How can one get the same behavior as before and look up files relative to PATH regardless of them having a '/' in them? Why

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Chet Ramey
On 2/28/12 5:49 PM, John Kearney wrote: > On 02/28/2012 11:44 PM, Chet Ramey wrote: >> echo "$(echo '$bar')" > > actually these both output the same in bash > echo "$(echo '$bar')" > echo $(echo '$bar') Sure: the outer quotes don't affect the command between the parens. Not only is it a new quot

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
On 02/28/2012 11:23 PM, Chet Ramey wrote: > On 2/28/12 5:18 PM, John Kearney wrote: >> On 02/28/2012 11:07 PM, Chet Ramey wrote: >>> On 2/28/12 4:28 PM, John Kearney wrote: On 02/28/2012 10:05 PM, Chet Ramey wrote: > On 2/28/12 12:26 PM, John Kearney wrote: > >> But that isn't

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
On 02/28/2012 11:44 PM, Chet Ramey wrote: > echo "$(echo '$bar')" actually these both output the same in bash echo "$(echo '$bar')" echo $(echo '$bar')

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Chet Ramey
On 2/28/12 5:30 PM, Maarten Billemont wrote: >>> 1${A:-B}2 >>> >>> Logically for consistancy having double quotes at position 1 and 2 >>> should have no effect on how you treat string B. >> >> Maybe, but that's not how things work in practice. Should the following >> expansions output the same th

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
On 02/28/2012 11:23 PM, Chet Ramey wrote: > On 2/28/12 5:18 PM, John Kearney wrote: >> On 02/28/2012 11:07 PM, Chet Ramey wrote: >>> On 2/28/12 4:28 PM, John Kearney wrote: On 02/28/2012 10:05 PM, Chet Ramey wrote: > On 2/28/12 12:26 PM, John Kearney wrote: > >> But that isn't

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Maarten Billemont
On 28 Feb 2012, at 23:23, Chet Ramey wrote: > On 2/28/12 5:18 PM, John Kearney wrote: >> On 02/28/2012 11:07 PM, Chet Ramey wrote: >>> On 2/28/12 4:28 PM, John Kearney wrote: On 02/28/2012 10:05 PM, Chet Ramey wrote: > On 2/28/12 12:26 PM, John Kearney wrote: > >> But that i

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Chet Ramey
On 2/28/12 5:18 PM, John Kearney wrote: > On 02/28/2012 11:07 PM, Chet Ramey wrote: >> On 2/28/12 4:28 PM, John Kearney wrote: >>> >>> On 02/28/2012 10:05 PM, Chet Ramey wrote: On 2/28/12 12:26 PM, John Kearney wrote: > But that isn't how it behaves. "${test//str/""}" > >

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
On 02/28/2012 11:15 PM, Chet Ramey wrote: > On 2/28/12 5:07 PM, Chet Ramey wrote: > >>> yhea but I think the point is that the current behavior is useless. >>> there is no case where I want a " to be printed and start a double >>> quoted string? and thats the current behavior. >>> >>> >>> Not so i

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
On 02/28/2012 11:07 PM, Chet Ramey wrote: > On 2/28/12 4:28 PM, John Kearney wrote: >> >> On 02/28/2012 10:05 PM, Chet Ramey wrote: >>> On 2/28/12 12:26 PM, John Kearney wrote: >>> But that isn't how it behaves. "${test//str/""}" because str is replaced with '""' as such i

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Chet Ramey
On 2/28/12 5:07 PM, Chet Ramey wrote: >> yhea but I think the point is that the current behavior is useless. >> there is no case where I want a " to be printed and start a double >> quoted string? and thats the current behavior. >> >> >> Not so important how you treat it just need to pick 1. then

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Chet Ramey
On 2/28/12 4:28 PM, John Kearney wrote: > > On 02/28/2012 10:05 PM, Chet Ramey wrote: >> On 2/28/12 12:26 PM, John Kearney wrote: >> >>> But that isn't how it behaves. >>> "${test//str/""}" >>> >>> because str is replaced with '""' as such it is treating the double >>> quotes as string lit

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
On 02/28/2012 10:05 PM, Chet Ramey wrote: > On 2/28/12 12:26 PM, John Kearney wrote: > >> But that isn't how it behaves. >> "${test//str/""}" >> >> because str is replaced with '""' as such it is treating the double >> quotes as string literals. >> >> however at the same time these litera

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Chet Ramey
On 2/28/12 12:26 PM, John Kearney wrote: > But that isn't how it behaves. > "${test//str/""}" > > because str is replaced with '""' as such it is treating the double > quotes as string literals. > > however at the same time these literal double quotes escape/quote a > single quote betwee

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Bob Proulx
John Kearney wrote: > Eric Blake wrote: > >> [ "${test}" = "${test//"'"/"'"}" ] || exit 999 > > > > exit 999 is pointless. It is the same as exit 231 on some shells, > > and according to POSIX, it is allowed to be a syntax error in other > > shells. > > I was going for || exit "Doomsday" i,e. 666

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
On 02/28/2012 07:00 PM, Dan Douglas wrote: > On Tuesday, February 28, 2012 06:52:13 PM John Kearney wrote: >> On 02/28/2012 06:43 PM, Dan Douglas wrote: >>> On Tuesday, February 28, 2012 06:38:22 PM John Kearney wrote: On 02/28/2012 06:31 PM, Dan Douglas wrote: > On Tuesday, February 28, 2

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Maarten Billemont
On 28 Feb 2012, at 18:52, John Kearney wrote: > On 02/28/2012 06:43 PM, Dan Douglas wrote: >> On Tuesday, February 28, 2012 06:38:22 PM John Kearney wrote: >>> On 02/28/2012 06:31 PM, Dan Douglas wrote: On Tuesday, February 28, 2012 05:53:32 PM Roman Rakus wrote: > On 02/28/2012 05:49 PM,

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
On 02/28/2012 06:52 PM, John Kearney wrote: > On 02/28/2012 06:43 PM, Dan Douglas wrote: >> On Tuesday, February 28, 2012 06:38:22 PM John Kearney wrote: >>> On 02/28/2012 06:31 PM, Dan Douglas wrote: On Tuesday, February 28, 2012 05:53:32 PM Roman Rakus wrote: > On 02/28/2012 05:49 PM, Gr

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Dan Douglas
On Tuesday, February 28, 2012 06:52:13 PM John Kearney wrote: > On 02/28/2012 06:43 PM, Dan Douglas wrote: > > On Tuesday, February 28, 2012 06:38:22 PM John Kearney wrote: > >> On 02/28/2012 06:31 PM, Dan Douglas wrote: > >>> On Tuesday, February 28, 2012 05:53:32 PM Roman Rakus wrote: > On 0

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
On 02/28/2012 06:43 PM, Dan Douglas wrote: > On Tuesday, February 28, 2012 06:38:22 PM John Kearney wrote: >> On 02/28/2012 06:31 PM, Dan Douglas wrote: >>> On Tuesday, February 28, 2012 05:53:32 PM Roman Rakus wrote: On 02/28/2012 05:49 PM, Greg Wooledge wrote: > On Tue, Feb 28, 2012 at 0

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Dan Douglas
On Tuesday, February 28, 2012 06:38:22 PM John Kearney wrote: > On 02/28/2012 06:31 PM, Dan Douglas wrote: > > On Tuesday, February 28, 2012 05:53:32 PM Roman Rakus wrote: > >> On 02/28/2012 05:49 PM, Greg Wooledge wrote: > >>> On Tue, Feb 28, 2012 at 05:36:47PM +0100, Roman Rakus wrote: > And

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
On 02/28/2012 06:31 PM, Dan Douglas wrote: > On Tuesday, February 28, 2012 05:53:32 PM Roman Rakus wrote: >> On 02/28/2012 05:49 PM, Greg Wooledge wrote: >>> On Tue, Feb 28, 2012 at 05:36:47PM +0100, Roman Rakus wrote: And that means, there isn't way to substitute "something" to ' (single

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Dan Douglas
On Tuesday, February 28, 2012 05:53:32 PM Roman Rakus wrote: > On 02/28/2012 05:49 PM, Greg Wooledge wrote: > > On Tue, Feb 28, 2012 at 05:36:47PM +0100, Roman Rakus wrote: > >> And that means, there isn't way to substitute "something" to ' (single > >> quote) when you want to not perform word spli

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
On 02/28/2012 06:16 PM, Eric Blake wrote: > On 02/28/2012 09:54 AM, John Kearney wrote: >> On 02/28/2012 05:22 PM, Roman Rakus wrote: >>> On 02/28/2012 05:10 PM, John Kearney wrote: wrap it with single quotes and globally replace all single quotes in the string with '\'' >>> single quote

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
On 02/28/2012 06:05 PM, Steven W. Orr wrote: > On 2/28/2012 11:54 AM, John Kearney wrote: >> On 02/28/2012 05:22 PM, Roman Rakus wrote: >>> On 02/28/2012 05:10 PM, John Kearney wrote: wrap it with single quotes and globally replace all single quotes in the string with '\'' >>> single quot

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Eric Blake
On 02/28/2012 09:54 AM, John Kearney wrote: > On 02/28/2012 05:22 PM, Roman Rakus wrote: >> On 02/28/2012 05:10 PM, John Kearney wrote: >>> wrap it with single quotes and globally replace all single quotes >>> in the string with '\'' >> single quote and slash have special meaning so they have to be

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Steven W. Orr
On 2/28/2012 11:54 AM, John Kearney wrote: On 02/28/2012 05:22 PM, Roman Rakus wrote: On 02/28/2012 05:10 PM, John Kearney wrote: wrap it with single quotes and globally replace all single quotes in the string with '\'' single quote and slash have special meaning so they have to be escaped, th

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
On 02/28/2012 05:22 PM, Roman Rakus wrote: > On 02/28/2012 05:10 PM, John Kearney wrote: >> wrap it with single quotes and globally replace all single quotes >> in the string with '\'' > single quote and slash have special meaning so they have to be > escaped, that's it. \'${var//\'/\\\'}\' it is n

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Roman Rakus
On 02/28/2012 05:49 PM, Greg Wooledge wrote: On Tue, Feb 28, 2012 at 05:36:47PM +0100, Roman Rakus wrote: And that means, there isn't way to substitute "something" to ' (single quote) when you want to not perform word splitting. I would consider it as a bug. imadev:~$ q=\' imadev:~$ input="foos

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Greg Wooledge
On Tue, Feb 28, 2012 at 05:36:47PM +0100, Roman Rakus wrote: > And that means, there isn't way to substitute "something" to ' (single > quote) when you want to not perform word splitting. I would consider it > as a bug. imadev:~$ q=\' imadev:~$ input="foosomethingbar" imadev:~$ echo "${input//so

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Roman Rakus
On 02/28/2012 05:22 PM, Roman Rakus wrote: On 02/28/2012 05:10 PM, John Kearney wrote: wrap it with single quotes and globally replace all single quotes in the string with '\'' single quote and slash have special meaning so they have to be escaped, that's it. \'${var//\'/\\\'}\' it is not quot

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Roman Rakus
On 02/28/2012 05:10 PM, John Kearney wrote: wrap it with single quotes and globally replace all single quotes in the string with '\'' single quote and slash have special meaning so they have to be escaped, that's it. \'${var//\'/\\\'}\' it is not quoted, so it undergoes word splitting. To avoid

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Greg Wooledge
On Tue, Feb 28, 2012 at 05:10:40PM +0100, John Kearney wrote: > so for the test case the goal is to take a string like > kljlksdjflsd'jkjkljl > wrap it with single quotes and globally replace all single quotes in the > string with '\'' Is this an SQL thing? Maybe you'd be better off using a langu

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
this all started with a wish to single quote a variable. Doesn't matter why I have multiple solutions to that now. But it it an interesting problem for exploring how escaping works in variable expansion. so for the test case the goal is to take a string like kljlksdjflsd'jkjkljl wrap it with sing

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Greg Wooledge
On Tue, Feb 28, 2012 at 04:52:48PM +0100, John Kearney wrote: > The standard work around you see is > echo -n \'${1//\'/\'\\\'\'}\'" " > but its not the same thing Workaround for what? Not the same thing as what? What is this pile of punctuation attempting to do? > # why does thi

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread John Kearney
Actually this is something that still really confuses me as well. In the end I gave up and just did this. local LName="'\\''" echo -n "'${1//"'"/${LName}}' " I still don't really understand why this wont work echo -n "'${1//"'"/"'\''"}' "

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Roman Rakus
On 02/28/2012 02:36 PM, Chet Ramey wrote: On 2/28/12 4:17 AM, lhun...@lyndir.com wrote: Configuration Information [Automatically generated, do not change]: Machine: i386 OS: darwin11.2.0 Compiler: /Developer/usr/bin/clang Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYP

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Chet Ramey
On 2/28/12 4:17 AM, lhun...@lyndir.com wrote: > Configuration Information [Automatically generated, do not change]: > Machine: i386 > OS: darwin11.2.0 > Compiler: /Developer/usr/bin/clang > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' > -DCONF_OSTYPE='darwin11.2.0' -DCONF_MACHTYPE=

Re: Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread Roman Rakus
On 02/28/2012 10:17 AM, lhun...@lyndir.com wrote: Configuration Information [Automatically generated, do not change]: Machine: i386 OS: darwin11.2.0 Compiler: /Developer/usr/bin/clang Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='darwin11.2.0' -DCONF_MACHTYPE='i386-

Inconsistent quote and escape handling in substitution part of parameter expansions.

2012-02-28 Thread lhunath
Configuration Information [Automatically generated, do not change]: Machine: i386 OS: darwin11.2.0 Compiler: /Developer/usr/bin/clang Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='darwin11.2.0' -DCONF_MACHTYPE='i386-apple-darwin11.2.0' -DCONF_VENDOR='apple' -DLOCALED