On 2005-06-22, [EMAIL PROTECTED] wrote:
> Hello,
>
> I have an if statement, something like:
>
> if [ "$day" = "Thu" ]; then
> tar -cpf /var/backups/homethu.tar /home
> fi
>
> If I decide to pound out the tar command, then the script
> will error and it won't continue on.
> Is it possible to pound out the tar command and still leave the if
> statement intact? even though there is no command to do.

if [ "$day" = "Thu" ]; then
  : tar -cpf /var/backups/homethu.tar /home
fi

-- 
    Chris F.A. Johnson                     <http://cfaj.freeshell.org>
    ==================================================================
    Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
    <http://www.torfree.net/~chris/books/cfaj/ssr.html>


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to