[nflug] bash scripting question

Daniel Magnuszewski dmagnuszewski at yahoo.com
Mon Jul 7 21:52:36 EDT 2008


...I forgot to include the exit logic (Plus, this is a cleaner format):

<code>

#!/bin/bash

if [ -e filename ];
then
        echo "Exiting Program"
        exit
fi
echo "Continue Program"


</code>

-Dan


----- Original Message ----
From: Daniel Magnuszewski <dmagnuszewski at yahoo.com>
To: nflug at nflug.org
Sent: Monday, July 7, 2008 9:46:35 PM
Subject: Re: [nflug] bash scripting question


if [ -e filename ]; then echo "exists"; fi



----- Original Message ----
From: Robert Wolfe <robert at muzzlethem.com>
To: nflug at nflug.org
Sent: Monday, July 7, 2008 9:29:06 PM
Subject: [nflug] bash scripting question

For the following script:

if test -e $a/$b; then printf "exists"; fi

If the condition is true, then I want the script to exit and not continue 
to run.  What command would I use and where would I put it in this 
statement?
_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.nflug.org/pipermail/nflug/attachments/20080707/f113722a/attachment.html


More information about the nflug mailing list