![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Checking the existence of a file.. | igandu | Shell Programming and Scripting | 7 | 06-13-2007 03:47 AM |
| checking file existence | DILEEP410 | Shell Programming and Scripting | 3 | 01-24-2007 12:43 PM |
| File existence problem | anormal | UNIX for Dummies Questions & Answers | 2 | 05-15-2006 12:54 PM |
| File existence | mpang_ | Shell Programming and Scripting | 2 | 03-27-2006 11:27 AM |
| Searching for the existence of a file | sbhan | UNIX for Advanced & Expert Users | 2 | 10-14-2002 04:02 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I wasn't sure if I should post it here of in the Shell Script category, but I figured it was definitely a newbie question.
I'm trying to write a script that will check for the existence of a specific file (or for any files within the directory) and then take specific actions. I've removed all the extra processing in the loop, comments, and variables. I'm just trying to get my basic loop to work. I did check the FAQ's but I think this is even too basic a question for there. Anyone's assistance with this would be appreciated. #!/bin/sh if (test.dat exists in current directory) then echo "test.dat exists!" |mail noone@domain.com else echo "test.dat does not exist!" |mail noone@domain.com fi |
|
||||
|
What does the -f mean before the filename? I did receive and proper response e-mail when I used this. I also just tried "ls filename" and had the same result.
If I were to look for the existence of any file in that directory, would I just replace the filename with * ? Thanks again! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|