What does this sh script line do?

Chet Ramey chet at odin.INS.CWRU.Edu
Thu Jun 13 06:09:58 AEST 1991


In article <2142 at mitisft.Convergent.COM> dold at mitisft.Convergent.COM (Clarence Dold) writes:

>> . ${NEWSCONFIG-/usr/lib/news/bin/config}

>Isn't the correct syntax ":-" ?  My shell likes it with or without the : 
>. ${NEWSCONFIG:-/usr/lib/news/bin/config}

No, not necessarily.  The `-' causes sh to substitute the RHS if the LHS
is unset.  The `:-' causes substitution if the LHS is unset or null.

Chet
-- 
                    ``You shoot John Sununu.  Twice.''

Chet Ramey			  Internet: chet at po.CWRU.Edu
Case Western Reserve University	  NeXT Mail: chet at macbeth.INS.CWRU.Edu



More information about the Comp.unix.questions mailing list