Le 12/05/2010 07:33, Andrew Clarke a écrit :
<snip>
Ok, that's what I was thinking. My original expression was a bit more
complex than this:
if [[ -n "$list" || ( $# -gt 1 && -t 0 && -t 1 ) ]]; then
well, in the current case, there is no really advantage of using (( ))
somewhere.
if you dislike the -gt, you may use > in place, the result will be the
same :
if [[ -n "$list" || ( $# > 1 && -t 0 && -t 1 ) ]]; then
Where list can be '' or 1
the -n "$list" can be substituted with ((list)) as long as the unset
value of $list is set to 0 - but then the expression maps to:
if (( $# > 1 )) && [[ -t 0 && -t 1 ]] || ((list)); then
IMHO, this is not equivalent to the first expression; it would something
like be :
if ( (( $# > 1 )) && [[ -t 0 && -t 1 ]] ) || ((list)); then
or
if ( (( $# > 1 )) && [[ -t 0 && -t 1 ]] ) || [[ -n ${list} ]]; then
note the ( ... )
Regards,
Cyrille Lefevre
--
mailto:[email protected]
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users