Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Idiom for booleans



On Aug 12,  5:24pm, Micah Elliott wrote:
}
}   % (( 0 ))
}   ((: command not found
}   % (( 1 ))  # ok

This has to be something in your configuration.  Try it with zsh -f ?

torch% (( 0 ))
torch% ((
math> ))
torch% (( 0 )) || echo nope
nope
torch% 

This one I'm not sure is intentional:

torch% (( )) || echo oops
oops
torch% 

} I'm trying to figure out if the $+ expansion, as in ${+param}, is
} worth making use of. What idiom do you use for it? I could see it as a
} boolean for testing flags.

Yes, that's a common usage.



Messages sorted by: Reverse Date, Date, Thread, Author