Advertisement
Guest User

How to determine if a file exists

a guest
Jul 30th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.15 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. for fname in file1 file2 file3 file4 file5
  4. do
  5.      if [ -e "$fname" ]
  6.      then
  7.            printf "%s exists!" "$fname"
  8.      fi
  9. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement