Re: small if statement in shell script
On Wednesday 22 June 2005 14:35, michael@etalon.net 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.
>
> Thanks!
> Mike
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
You have to have something for the shell to run. Try setting a new variable to
1 or some such silly-ness and it will work. Or else you have to comment out
the entire if statement.
Reply to: