On Tue, Sep 30, 2008 at 1:48 PM, Andrew Farnsworth <[EMAIL PROTECTED]> wrote:
> Trying to decipher a Korn Shell script written by someone else. What
> exactly do these two lines do?
>
> cp ${FILE:-null} ${LOG_WEEK_OLD}
> rm -f ${FILE:-null}
A quick trip to the ksh manpage[0] under parameter expansion tells me:
${parameter :-word }
If parameter is set and is non-null then substitute its value;
otherwise substitute word.
Perhaps this sheds some more light on the meaning of those statements? =)
[0] -
http://www.cs.princeton.edu/~jlk/kornshell/doc/man93.html#Parameter%20Expansion
--
Brandon D. Valentine
http://www.brandonvalentine.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"NLUG" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/nlug-talk?hl=en
-~----------~----~----~----~------~----~------~--~---