[nflug] bash scripting question

Corey Reichle coreyreichle at verizon.net
Mon Jul 7 21:59:50 EDT 2008


Yeah, I like his better too :)  I'd only add the exit error code in case
it's needed further down the road.
On Mon, 2008-07-07 at 18:52 -0700, Daniel Magnuszewski wrote:
> ...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
> 
> _______________________________________________
> nflug mailing list
> nflug at nflug.org
> http://www.nflug.org/mailman/listinfo/nflug



More information about the nflug mailing list