Re: Simple frage zu shell-script

From: Oliver Lehmann <lehmann(at)ans-netz.de>
Date: Mon, 15 Sep 2003 14:16:23 +0200

Schonder, Matthias wrote:

> Hei :)
>
> unter der bash krieg ich mit dem -e raus ob ne datei existiert also auf
> die art

bash - bah >:)

richtig waere:

if [ -e "file" ] ; then
        echo OK
else
        echo nicht Ok
fi

bitte immer mit "; then"

es ginge auch noch

[ -e "file" ] && echo "Ok" || echo "nich Ok" ;)

-- 
 Oliver Lehmann
        @home: lehmann(at)ans-netz.de
      @office: oliver.lehmann(at)mgi.de
         @www: http://www.pofo.de/  |  http://wishlist.ans-netz.de/
To Unsubscribe: send mail to majordomo.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Mon 15 Sep 2003 - 14:18:34 CEST

search this site