Re: How can I check in a bash-script wether a directory exists or not
From: cheesenhomer (kesenhei_at_de.ibm.com)
Date: 04/20/04
- Next message: Dan Espen: "Re: How can I check in a bash-script wether a directory exists or not"
- Previous message: David Haggett: "Re: Age old Q again: Recommendations for using LDAP for Active Directory?"
- In reply to: Michael Heiming: "Re: How can I check in a bash-script wether a directory exists or not"
- Next in thread: Dan Espen: "Re: How can I check in a bash-script wether a directory exists or not"
- Reply: Dan Espen: "Re: How can I check in a bash-script wether a directory exists or not"
- Reply: Alan Connor: "Re: How can I check in a bash-script wether a directory exists or not"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 20 Apr 2004 09:44:28 -0700
Michael Heiming <michael+USENET@www.heiming.de> wrote in message news:<e77fl1-i0i.ln1@news.heiming.de>...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> NotDashEscaped: You need GnuPG to verify this message
>
> cheesenhomer <kesenhei@de.ibm.com> wrote:
> > Hi,
>
> > i need to check in a bash-script wether a directory exist or not. I've
> > tried it with the 'cd' commad and a if-statement (check the output of
> > the cd-command), but it doesn't really work. I only get an error
> > message like...
>
> if [ -d "${dir}" ]; then echo yep;fi
>
> Hint:
> man test
OK, I've tried your tips, but nothing really worked. If I use your tip
with the if-statement (slightly changed, due to errors), it executes
the echo ok also for directory which don't exists. So it looks very
strange. If I use 'if [ -d $"{dir}" ];' I got the error "bad
substitution".
So what's going on there???!?
Cheesenhomer
- Next message: Dan Espen: "Re: How can I check in a bash-script wether a directory exists or not"
- Previous message: David Haggett: "Re: Age old Q again: Recommendations for using LDAP for Active Directory?"
- In reply to: Michael Heiming: "Re: How can I check in a bash-script wether a directory exists or not"
- Next in thread: Dan Espen: "Re: How can I check in a bash-script wether a directory exists or not"
- Reply: Dan Espen: "Re: How can I check in a bash-script wether a directory exists or not"
- Reply: Alan Connor: "Re: How can I check in a bash-script wether a directory exists or not"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|