[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pon



On Thu, Sep 20, 2001 at 01:11:25AM +0000, gerard robin wrote:
> "pon"  is a very simple script:
> 
> exec /usr/sbin/pppd call ${1;-provider}
> 
> I think that the script :
> 
> exec /usr/sbin/pppd call provider
> 
> would work too.
> 
> can someone explain me the meaning of  ${1;-provider}

Here, it's ${@:-provider}. You can find out the meaning of that by
running 'man bash' and searching for 'Parameter Expansion': it means
that, if $@ is unset or empty, use 'provider', otherwise use $@ (which
expands to the arguments given on the command line - $1 expands to the
first argument).

Briefly, that means that you can run 'pon myisp' and it'll run 'pppd
call myisp', but if you just run 'pon' you'll get 'pppd call provider'.

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: