Re: Testing Bash 4.0

2009-01-29 Thread Roman Rakus

Chet Ramey wrote:
2 when running scripts the script works, but get constant output of 
TRACE: pid 7958: parse_and_execute: turned on CMD_IGNORE_RETURN from 
comsub_ignore_return
TRACE: pid 7964: parse_and_execute: turned on CMD_IGNORE_RETURN from 
comsub_ignore_return
TRACE: pid 7968: parse_and_execute: turned on CMD_IGNORE_RETURN from 
comsub_ignore_return


How do I disable that?



It's a debugging message so I can get an idea of how often it happens.  You
have to edit it out of the source: builtins/evalstring.c:271.

Chet

  

There is more debug outputs:

When I run something like:

$ find /usr | while read x; do ls "$x"; done >/dev/null

I start getting lots of bash debug output on the terminal:

TRACE: pid 24674: realloc_jobs_list: resize jobs list from 128 to 136
TRACE: pid 24674: realloc_jobs_list: j_lastj changed from 127 to 127
TRACE: pid 24674: realloc_jobs_list: j_njobs changed from 128 to 128
TRACE: pid 24674: realloc_jobs_list: js.j_ndead 128 js.c_reaped 128
TRACE: pid 24674: realloc_jobs_list: reset js.j_current (-1) and js.j_previous
(-1)
TRACE: pid 24674: compact_jobs_list: returning 128
TRACE: pid 24674: realloc_jobs_list: resize jobs list from 136 to 144
TRACE: pid 24674: realloc_jobs_list: j_lastj changed from 135 to 135
TRACE: pid 24674: realloc_jobs_list: j_njobs changed from 136 to 136
TRACE: pid 24674: realloc_jobs_list: js.j_ndead 136 js.c_reaped 136
TRACE: pid 24674: realloc_jobs_list: reset js.j_current (-1) and js.j_previous
(-1)

...


RR




Re: Testing Bash 4.0

2009-01-29 Thread Roman Rakus

Roman Rakus wrote:

Chet Ramey wrote:
2 when running scripts the script works, but get constant output of 
TRACE: pid 7958: parse_and_execute: turned on CMD_IGNORE_RETURN from 
comsub_ignore_return
TRACE: pid 7964: parse_and_execute: turned on CMD_IGNORE_RETURN from 
comsub_ignore_return
TRACE: pid 7968: parse_and_execute: turned on CMD_IGNORE_RETURN from 
comsub_ignore_return


How do I disable that?



It's a debugging message so I can get an idea of how often it 
happens.  You

have to edit it out of the source: builtins/evalstring.c:271.

Chet

  

There is more debug outputs:

When I run something like:

$ find /usr | while read x; do ls "$x"; done >/dev/null

I start getting lots of bash debug output on the terminal:

TRACE: pid 24674: realloc_jobs_list: resize jobs list from 128 to 136
TRACE: pid 24674: realloc_jobs_list: j_lastj changed from 127 to 127
TRACE: pid 24674: realloc_jobs_list: j_njobs changed from 128 to 128
TRACE: pid 24674: realloc_jobs_list: js.j_ndead 128 js.c_reaped 128
TRACE: pid 24674: realloc_jobs_list: reset js.j_current (-1) and 
js.j_previous

(-1)
TRACE: pid 24674: compact_jobs_list: returning 128
TRACE: pid 24674: realloc_jobs_list: resize jobs list from 136 to 144
TRACE: pid 24674: realloc_jobs_list: j_lastj changed from 135 to 135
TRACE: pid 24674: realloc_jobs_list: j_njobs changed from 136 to 136
TRACE: pid 24674: realloc_jobs_list: js.j_ndead 136 js.c_reaped 136
TRACE: pid 24674: realloc_jobs_list: reset js.j_current (-1) and 
js.j_previous

(-1)

...


RR


Ok, it was because enabled DEBUG. So to avoid messages like "TRACE: pid 
7968: parse_and_execute: turned on CMD_IGNORE_RETURN from 
comsub_ignore_return" the best is to get ifdefed 
builtins/evalstring.c:271, I think.

RR




Question about behavior of redirections inside an if construct

2009-01-29 Thread Thomas Schwinge
Hello!

I'm probably only missing something very obvious, but...

tho...@dirichlet:~ $ bash --version
GNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
tho...@dirichlet:~ $ bash -c 'if { :; } 2> /dev/null < NONEXISTING_FILE; 
then :; else echo >&2 OK; fi'
OK
tho...@dirichlet:~ $ sh -c 'if { :; } 2> /dev/null < NONEXISTING_FILE; then 
:; else echo >&2 OK; fi'
OK
tho...@dirichlet:~ $ bash -c 'if : 2> /dev/null < NONEXISTING_FILE; then :; 
else echo >&2 OK; fi'
OK

These three work as expected.  But why doesn't the following one?

tho...@dirichlet:~ $ sh -c 'if : 2> /dev/null < NONEXISTING_FILE; then :; 
else echo >&2 OK; fi'

(no output)


Regards,
 Thomas


signature.asc
Description: Digital signature


Re: Question about behavior of redirections inside an if construct

2009-01-29 Thread Andreas Schwab
Thomas Schwinge  writes:

> These three work as expected.  But why doesn't the following one?
>
> tho...@dirichlet:~ $ sh -c 'if : 2> /dev/null < NONEXISTING_FILE; then :; 
> else echo >&2 OK; fi'

Works fine here.  Are you sure sh is Bash?

Andreas.

-- 
Andreas Schwab, SuSE Labs, sch...@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Re: Question about behavior of redirections inside an if construct

2009-01-29 Thread Thomas Schwinge
Hello!

On Thu, Jan 29, 2009 at 05:47:53PM +0100, Andreas Schwab wrote:
> Thomas Schwinge  writes:
> > These three work as expected.  But why doesn't the following one?
> >
> > tho...@dirichlet:~ $ sh -c 'if : 2> /dev/null < NONEXISTING_FILE; then 
> > :; else echo >&2 OK; fi'
> 
> Works fine here.  Are you sure sh is Bash?

Why would sh be something differe...

tho...@dirichlet:~ $ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2007-12-25 23:16 /bin/sh -> dash

Jeez.

That's Ubuntu intrepid 0.5.4-9ubuntu1 version.  Unless someone beats me
to it, or it is fixed already, I'll take it up with them, sometime later.


Andreas: Thanks for pointing out the obvious!


Regards,
 Thomas


signature.asc
Description: Digital signature


Re: Question about behavior of redirections inside an if construct

2009-01-29 Thread Chet Ramey
> > Works fine here.  Are you sure sh is Bash?
> 
> Why would sh be something differe...

It's a mystery. :-)

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRUc...@case.eduhttp://tiswww.tis.case.edu/~chet/