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

Re: default values



Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> writes:

> ${NAME-WORD} ${NAME:-WORD} If NAME is set, or in the
> second form is non-null, then substitute its value;
> otherwise substitute WORD. In the second form NAME may
> be omitted, in which case WORD is always substituted.
>
> So e.g.
>
>     local num_files=${1:-10} local where=${2:-./}

Excellent, thanks!

-- 
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
                   - so far: 20 Blogomatic articles -                   



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