Last active
August 29, 2015 13:57
-
-
Save odadoda/9410670 to your computer and use it in GitHub Desktop.
check file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# check if param 1 is not empty and if the file exists | |
if [ -z $1 ] ; then | |
echo "Param 1 missing. Must have a file to present." | |
exit | |
else | |
FILE="$1" | |
fi | |
if [ ! -f $FILE ] ; then | |
echo "File not found." | |
exit | |
fi | |
# count lines | |
file_lines_count=`cat $FILE | wc -l `; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment