The '-s' parameter needs to have an argument (which is the file name), ie:
if [ -s "$1" ]
# file is non-zero
# file is zero
And so you don't need the test
statement at all. Notice that the '-s' check is for a non-zero
file, so you will need to swap around the content bodies of the then
and the else
It is useful to use double quotes around the $1; it still gets expanded, but it means that if the filename has characters such as spaces, the name will still get treated as a single item.
Also, you don't need to echo the output from the ls
since it already outputs its result; just have the ls
statement directly in the body.