What does extquote do

2005-10-16 Thread Enrique Perez-Terron

I am unable to make sense of the bash man-page description of the
extquote shopt option.

It says:

  extquote
   If set, $’string’ and $"string" quoting is performed within
   ${parameter} expansions enclosed in double quotes.  This option
   is enabled by default.

Can anybody come up with an example where the setting of extquote
makes a difference?   I would actually like to have two examples,
one with $'string' and one with $"string".

-Enrique


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: extglob problems in bash

2005-10-16 Thread Enrique Perez-Terron


On Sun, 16 Oct 2005 17:10:48 +0200, <[EMAIL PROTECTED]>
posted on comp.unix.shell:


I have a problem that I'm trying to solve with the help of extended
globbing. It doesn't work, and so I've narrowed down the buggy bit to a
simple, illustrative example.

I need to match literal parentheses in a globbing pattern. Normally it
works OK:

$ touch foo\(
$ ls foo\(
foo(

But with extglob operators, I cannot match parentheses. Here is a very
simple example:

$ shopt -s extglob
$ ls @(foo\()
-bash: syntax error near unexpected token `('


I get a different result, but still not as I would expect:

   $ touch foo\(
   $ ls foo*
   foo(
   $ shopt -s extglob
   $ ls @(foo\()
   ls: @(foo(): No such file or directory
   $ ls @(foo*)
   foo(
   $ echo $BASH_VERSION
   3.00.16(1)-release

-Enrique


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


sigsegv in rl_resize_terminal

2005-10-16 Thread Sam Steingold
I get this:

Program received signal SIGSEGV, Segmentation fault.
0x2821e472 in rl_resize_terminal () from /usr/lib/libreadline.so.4

(FreeBSD x86-freebsd1 4.11-RELEASE FreeBSD 4.11-RELEASE #0: Wed Oct  5 21:16:58 
PDT 2005 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC  i386)

what are the rules for invoking rl_resize_terminal?
do I need to call rl_initialize() or readline() before rl_resize_terminal?

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
 
 
Linux - find out what you've been missing while you've been rebooting Windows.



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: What does extquote do

2005-10-16 Thread Chet Ramey
Enrique Perez-Terron wrote:
> I am unable to make sense of the bash man-page description of the
> extquote shopt option.
> 
> It says:
> 
>   extquote
>If set, $’string’ and $"string" quoting is performed within
>${parameter} expansions enclosed in double quotes.  This option
>is enabled by default.
> 
> Can anybody come up with an example where the setting of extquote
> makes a difference?   I would actually like to have two examples,
> one with $'string' and one with $"string".

Sure.  Run the following:

shopt -u extquote

echo "${v:-$"translate me"}"
echo "${v:-$'ab\ncd'}"

shopt -s extquote

echo "${v:-$"translate me"}"
echo "${v:-$'ab\ncd'}"

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live Strong.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: extglob problems in bash

2005-10-16 Thread Chet Ramey
Enrique Perez-Terron wrote:
> 
> On Sun, 16 Oct 2005 17:10:48 +0200, <[EMAIL PROTECTED]>
> posted on comp.unix.shell:
> 
>> I have a problem that I'm trying to solve with the help of extended
>> globbing. It doesn't work, and so I've narrowed down the buggy bit to a
>> simple, illustrative example.
>>
>> I need to match literal parentheses in a globbing pattern. Normally it
>> works OK:
>>
>> $ touch foo\(
>> $ ls foo\(
>> foo(
>>
>> But with extglob operators, I cannot match parentheses. Here is a very
>> simple example:
>>
>> $ shopt -s extglob
>> $ ls @(foo\()
>> -bash: syntax error near unexpected token `('
> 
> 
> I get a different result, but still not as I would expect:

Looks like a bug.  I'll take a look.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live Strong.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: sigsegv in rl_resize_terminal

2005-10-16 Thread Chet Ramey
Sam Steingold wrote:
> I get this:
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x2821e472 in rl_resize_terminal () from /usr/lib/libreadline.so.4
> 
> (FreeBSD x86-freebsd1 4.11-RELEASE FreeBSD 4.11-RELEASE #0: Wed Oct  5 
> 21:16:58 PDT 2005 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC  i386)
> 
> what are the rules for invoking rl_resize_terminal?
> do I need to call rl_initialize() or readline() before rl_resize_terminal?

Certainly rl_intialize at least, and readline to avoid unexpected and
bizarre output, since rl_resize_terminal calls the display code.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live Strong.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: sigsegv in rl_resize_terminal

2005-10-16 Thread Sam Steingold
> * Chet Ramey <[EMAIL PROTECTED]> [2005-10-16 17:53:39 -0400]:
>
> Sam Steingold wrote:
>> I get this:
>> 
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x2821e472 in rl_resize_terminal () from /usr/lib/libreadline.so.4
>> 
>> (FreeBSD x86-freebsd1 4.11-RELEASE FreeBSD 4.11-RELEASE #0: Wed Oct  5 
>> 21:16:58 PDT 2005 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC  i386)
>> 
>> what are the rules for invoking rl_resize_terminal?
>> do I need to call rl_initialize() or readline() before rl_resize_terminal?
>
> Certainly rl_intialize at least, and readline to avoid unexpected and
> bizarre output, since rl_resize_terminal calls the display code.

is there a way to check whether readline has been initialized already?
e.g., clisp may be running interactively and using readline and it may
be running in the batch mode and not using readline (so when the
SIGWINCH handler is called, readline has not been initialized).
what is TRT?

thanks!

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
 
  
Bill Gates is not god and Microsoft is not heaven.



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: sigsegv in rl_resize_terminal

2005-10-16 Thread Chet Ramey
Sam Steingold wrote:
>>* Chet Ramey <[EMAIL PROTECTED]> [2005-10-16 17:53:39 -0400]:
>>
>>Sam Steingold wrote:

> 
> is there a way to check whether readline has been initialized already?
> e.g., clisp may be running interactively and using readline and it may
> be running in the batch mode and not using readline (so when the
> SIGWINCH handler is called, readline has not been initialized).

The rl_readline_state variable has the RL_INITIALIZED bit set after
initialization.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live Strong.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: sigsegv in rl_resize_terminal

2005-10-16 Thread Sam Steingold
> * Chet Ramey <[EMAIL PROTECTED]> [2005-10-16 22:38:38 -0400]:
>
> Sam Steingold wrote:
>>>* Chet Ramey <[EMAIL PROTECTED]> [2005-10-16 17:53:39 -0400]:
>>>
>>>Sam Steingold wrote:
>
>> 
>> is there a way to check whether readline has been initialized already?
>> e.g., clisp may be running interactively and using readline and it may
>> be running in the batch mode and not using readline (so when the
>> SIGWINCH handler is called, readline has not been initialized).
>
> The rl_readline_state variable has the RL_INITIALIZED bit set after
> initialization.

thanks a lot!
Do I understand correctly that

 #if defined(HAVE_READLINE) && defined(RL_ISSTATE) && defined(RL_INITIALIZED)
  if (RL_ISSTATE(RL_INITIALIZED))
rl_resize_terminal();
 #endif

is the right way to do that?
Thanks!

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
 
 
Your mouse pad is incompatible with MS Windows - your HD will be reformatted.


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


extglob operators incorrectly handle literal parens

2005-10-16 Thread Alistair Happencross

I am using bash version 3.00.16(1)-release on Mac OS X.

The problem is that literal parentheses are not matched correctly when
they are specified inside extglob operators.  Normal (non-extended)
patterns are fine:

$ touch foo\(
$ ls foo\(
foo(

But extended globbing doesn't work right:

$ shopt -s extglob
$ ls @(foo\()
ls: @(foo(): No such file or directory

Same error with the other extglob operators ?(), *(), +() and !().

Alistair

_
Access your Hotmail straight from your i-mode mobile 
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fadsfac%2Enet%2Flink%2Easp%3Fcc%3DTEL175%2E16267%2E0&_t=751223833&_m=EXT




___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash