![]() |
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 |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| check if remote file exists | hcclnoodles | Shell Programming and Scripting | 2 | 08-27-2008 05:53 PM |
| Check if a file exists with certain prefix | raoscb | Shell Programming and Scripting | 11 | 08-20-2008 08:13 AM |
| check if file exists on remote system ? | hcclnoodles | Shell Programming and Scripting | 2 | 10-26-2006 04:08 AM |
| check if exists a .ZIP file and unzip it using ftp | DebianJ | Shell Programming and Scripting | 1 | 05-05-2005 04:46 PM |
| perl ftp check file exists | methos | Shell Programming and Scripting | 2 | 06-18-2003 08:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to check if a file exists using the if statement
Hi,
I'm trying to write a bit of code that will check if a file exists and then archives the file Im trying to use the following if statement without success.. if [ -f = "filename" ] then mv filename archive/filename else echo "no filename exists" fi Should the file name be in quotes? My code's not finding the file, it alway moves on to the else section... EDIT* I'm scripting in KSH.. Last edited by Jazmania; 09-19-2008 at 12:18 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|