How to get the size of a file in bash script?

stat -c%s "$filename"