I am writing a UNIX script that reads the size of a text file and if the file is of some size it should print the text file. If it is not an else loop executes and the process c
I wouldn't recomment stat which is not portable not being specified by POSIX.
stat
Here is a safer way to get the file size in a variable.
size=$(ls -dnL -- "${filepath}/{filename}.lst" | awk '{print $5;exit}')