I am trying to make a shell script that will take the file name as an argument and then display the file size of the file in bytes. However I am unsure how to check that the user supplied only a single argument and that the file name exists.
Any help would be appricated
#!/bin/bash
FILENAME-echo -n :Enter name of file"
read sourcefile
FILESIZE=$(stat -c%s "FILENAME")
echo "Size of $FILENAME = $FILESIZE bytes."