Skip to content

Instantly share code, notes, and snippets.

@rkennesson
Forked from seanbuscay/if_file_exists.sh
Created November 6, 2016 17:00
Show Gist options
  • Select an option

  • Save rkennesson/9c0d05cb4989443a65cf80f83a0af989 to your computer and use it in GitHub Desktop.

Select an option

Save rkennesson/9c0d05cb4989443a65cf80f83a0af989 to your computer and use it in GitHub Desktop.
Check if file existsd
#!/bin/bash
FILE=$1
 
if [ -f $FILE ];
then
echo "File $FILE exists"
else
echo "File $FILE does not exists"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment