.sh & getopts

CyberLeo Kitsana cyberleo at cyberleo.net
Sun Jun 6 04:40:24 UTC 2010

On 06/05/2010 10:56 PM, Aiza wrote:
>    i) action="installworld"; $flag_count=$((flag_count+1));;
> ...
> What is still wrong here

Bourne shell expands variables to their contents before evaluating.
Thus, the above assignment ends up expanding to '0=1'. Leave out the $
on the target variable, and it becomes 'flag_count=1', which is more
likely what you intended.

The other syntax does make for some pretty nifty hacks, though.

Fuzzy love,
Technical Administrator
CyberLeo.Net Webhosting
<CyberLeo at CyberLeo.Net>

Furry Peace! - http://wwww.fur.com/peace/

More information about the freebsd-questions mailing list