diff --git a/functions.sh b/functions.sh index 1558893..6e33b59 100755 --- a/functions.sh +++ b/functions.sh @@ -18,6 +18,11 @@ function getMachineNumber { fi } +# get first line of file +function fisrstLine { + if [ ! -f $1 ] ; then echo -ne "0;" ; return 0 ; fi + head -n 1 $1 +} # file age # return 0 if given file mtime is older than given age (in day) # arg1: file @@ -65,10 +70,11 @@ function fileBiggerThan { if [ $filesize -lt $2 ] ; then echo -ne "0;" ; else echo -ne "1;" ; fi } + #Ok if file exists # arg1: file to check function fileMustExists { -if [ -f ${1} ] ; then echo -ne "1;" +if [ -f "${1}" ] ; then echo -ne "1;" else echo -ne "0;" fi }