Computing.Net > Forums > Unix > checking directory before executing

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

checking directory before executing

Reply to Message Icon

Name: sureshht
Date: March 26, 2007 at 07:38:50 Pacific
OS: AIX 5L
CPU/Ram: 4CPU/8GB RAM
Product: RS6000
Comment:

Hi,
I am executing set of if conditions for my rollover of logs script. If the file exists then roll them over with dates.
Now, I want to check whether the directory in which i am rolling over file, exists or not. if directory doesnot exists, I donot want to continue to rollover logs. I just want to come out of the loop.
I am not sure whether I am clear about what I want. Let me know if its not clear.

Thanks
Suresh

sureshht



Sponsored Link
Ads by Google

Response Number 1
Name: wollie
Date: March 27, 2007 at 00:31:15 Pacific
Reply:

if you just wnat to check if the directory does exist:

test - command (man test)

cheers

Wollie


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: checking directory before executing

Syntax problem with find cmd in scr www.computing.net/answers/unix/syntax-problem-with-find-cmd-in-scr/8174.html

Find file & execute command www.computing.net/answers/unix/find-file-amp-execute-command/6624.html

Determine a script's execution dir? www.computing.net/answers/unix/determine-a-scripts-execution-dir/6717.html