Re: declare -ia does not enfore integer type on initialisation

2014-02-05 Thread Peggy Russell
I stopped looking). Perhaps documenting the behavior would be helpful. Maybe the last sentence to the declare help could say, "Attributes added with -a or -A do not take effect until subsequent assignments." Peggy Russell

Documentation update for case in shell's builtin help

2014-01-31 Thread Peggy Russell
Release 4.3.0(1)-rc2 The help for "case", in the shell's builtin command "help", shows the operator ;; but not the operators ;& and ;;&. help case Peg Russell

Re: Why bash doesn't have bug reporting site?

2014-01-13 Thread Peggy Russell
> I noticed that bash is in absolute minority of projects not using any > bug reporting system. Instead, users are directed to this ML to report bugs. Also see: man bashbug Maybe an RSS feed could help, like: http://rss.gmane.org/gmane.comp.shells.bash.bugs Peggy Russell

Behavior change/feature : display -p var; where var is a "placeholder" variable

2014-01-08 Thread Peggy Russell
p var 3) declare -i var1= var2; declare -p ${!var*} where the option 'i' above could be 'iaAnr' (1)(2)(3) and with the additional '-' in (2)(3). Peggy Russell

Re: RFC: turn off word splitting for vars but keep for read

2013-11-22 Thread Peggy Russell
provide a supportive argument, maybe, for your suggestion option #1. http://mywiki.wooledge.org/Quotes is helpful. Peggy Russell

Re: declare -g var should return a nonzero return code when it fails

2013-11-04 Thread Peggy Russell
t isn't failing at all. Declaring a global variable that already exists as a globally scoped variable is a no-op, and in a function declaring a global variable that already exists as a locally scoped variable, bash uses the locally scoped variable. Thank you. Peggy Russell

declare -g var should return a nonzero return code when it fails

2013-10-31 Thread Peggy Russell
;data2" 3 test_error: rc [0] <=== ./zt: line 18: declare: var: not found <=== declare -- var="data3" == test_error: [] === Peggy Russell

bug-bash@gnu.org

2013-10-30 Thread Peggy Russell
GN-*" Greg added the quotes. Thanks. I tested with: mkdir "dir with spaces" touch "dir with spaces"/simple-{a..c} "dir with spaces"/test-abc-IGN-def "dir with spaces/spa ces" ./scriptname "dir with spaces" Worked as expected. Peggy Russell

bug-bash@gnu.org

2013-10-30 Thread Peggy Russell
nd such? A variation: shopt -s nullglob for f in ${1:-.}/*; do if [[ "${f}" != *-IGN-* ]]; then printf -- '%s\n' "${f}" fi done Peggy Russell

Re: Yet another quoting question

2011-05-09 Thread Peggy Russell
> For straight debugging output, it's probably ok. You might have to > play with it a little if you want to make it into something you can > eval from a command substitution to copy an array. Just another thought, declare -p aa is nice for debugging arrays. help declare ... -pdisplay t

Re: set -x and parameter expansion

2011-03-13 Thread Peggy Russell
ontents of r which was 0 [[ $? -eq $r ]] + [[ 0 -eq 0 ]] [[ $? -eq ${r:=0} ]]+ [[ 0 -eq 0 ]] For a user to see/trace r, they would either echo/printf, declare -p r, or refer to it as $r (displayed by set -x). Can users see more trace info on what happens within [[ (i.e.; [['s value for r)? Thank you. Peggy Russell

set -x and parameter expansion

2011-03-13 Thread Peggy Russell
f [[ $? -eq $r ]]; then echo "4 Y"; else echo "N";fi ... + [[ 0 -eq 0 ]] + echo '4 Y' (Similar to 3) unset r a; a=0; declare -i r=a /bin/true; if [[ $? -eq r ]]; then echo "5 Y"; else echo "N";fi ... + [[ 0 -eq r ]] <- + echo '2 Y' Thank you. Peggy Russell

Re: variable name and its' value are the same characters causes recursion error

2011-03-09 Thread Peggy Russell
> The existing documentation seems pretty clear: > ... > The value of a variable is evaluated as an arithmetic expression when > it is referenced, or when a variable which has been given the integer > attribute using declare -i is assigned a value. A null value evaluates > to 0. A shell var

Re: variable name and its' value are the same characters causes recursion error

2011-03-07 Thread Peggy Russell
> Since those are not numeric, bash treats them as expressions to be > evaluated. You don't have to use the $ to obtain variable evaluation > when using [[ or [. You get: c=1;a="c";b=2;[[ a -lt b ]]; echo $? 0 c=3;a="c";b=2;[[ a -lt b ]]; echo $? 1 I see. I was aware of explicit indirection as

variable name and its' value are the same characters causes recursion error

2011-03-07 Thread Peggy Russell
an error occurs. * EXIT_SUCCESS = 0 * EXIT_FAILURE = non-zero value - When using compound commands, the exit status of 0 and nonzero still stands, but there is an intermediary step that deals with how conditional and arithmetic expressions are evaluated. - Arithmetic Evaluation ((...)): Within an expression, shell variables may be referenced by name without using the parameter expansion syntax. = Thank you. Peggy Russell