Brett Miller wrote:
> On Sep 30, 2008, at 1:48 PM, "Andrew Farnsworth" <[EMAIL PROTECTED]>
> wrote:
>
>
>> Ok,
>> 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}
>>
>> I think the first line copies "/dev/null" to the log file,
>> overwritting the log file with an empty log file. (i.e. this
>> truncates the file), but if that is the case what is with the second
>> line? How and why would you want to delete a null?
>>
>> Thanks,
>>
>> Andy
>>
>
> I'm just guessing, but I suspect it copies $FILE to $LOG_WEEK_OLD if
> $FILE is not null, then deletes $FILE if it is not null.
>
> Brett
>
> >
>
I think that the expression substitutes "null" if $FILE evaluates to
blank, so that the cp and rm commands won't complain about missing
arguments.
--
John F. Eldredge -- [EMAIL PROTECTED]
PGP key available from http://pgp.mit.edu
"Reserve your right to think, for even to think wrongly is better
than not to think at all." -- Hypatia of Alexandria
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---