Re: find help about 'read' built-in command

2007-11-14 Thread Bob Proulx
Mike Stroyan wrote: > 龙海涛 wrote: > > Bob Proulx wrote: > > > test=$(pwd) > > > echo $test > > By the way, the variable "$PWD" has the same current directory value > as "$(pwd)" . Yes, you have a point, but... Even though this is a bash list I still prefer to use standard constructs when poss

Re: is this a bug?

2007-11-14 Thread Chet Ramey
> > It's not a bug. the exit status of a command, the "return" of your > > function, is limited to the numbers 0-255. > > It's 0-128, actually. Whoops, no, you're right. You just can't count on exit statuses greater than 127 not conflicting with processes exiting due to a signal, so practice is

Re: history not restore stdout

2007-11-14 Thread Chet Ramey
> Machine Type: i686-pc-linux-gnu > > Bash Version: 3.2 > Patch Level: 0 > Release Status: release > > Description: > history builtin command no reconect stdout if fail: > > $ history >new_out bad_argument > -bash: history: bad_argument: numeric argument required > > in

Re: is this a bug?

2007-11-14 Thread Chet Ramey
> It's not a bug. the exit status of a command, the "return" of your > function, is limited to the numbers 0-255. It's 0-128, actually. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Live Strong. Chet Ramey, ITS, CWRU[EMAIL PROTECTED]

Some broken UTF-8 sequence causes bash to infinite loop.

2007-11-14 Thread Morita Sho
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale' -DPACK

Re: is this a bug?

2007-11-14 Thread Pierre Gaston
On Nov 14, 2007 7:26 AM, naruto canada <[EMAIL PROTECTED]> wrote: > function fact { > local n=$1 > if [ "$n" -eq 0 ]; then > return 1 > else > fact $(( $n - 1 )) > return $(( $n * $? )) > fi > } > > for i in `seq 0 11`; do > fact $i ; echo $? > done > > > 1 > 1 > 2 > 6 > 24 > 12

is this a bug?

2007-11-14 Thread naruto canada
function fact { local n=$1 if [ "$n" -eq 0 ]; then return 1 else fact $(( $n - 1 )) return $(( $n * $? )) fi } for i in `seq 0 11`; do fact $i ; echo $? done 1 1 2 6 24 120 208 176 128 128 0 0 the results are wrong for 6 and above. is this a bug?

history not restore stdout

2007-11-14 Thread fede
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale' -DPACKA