I wonder, what's the best way to determine the size of a file using common unix tools. I need to determine the size of a file in bytes in a shell script. The problem is, that the shell script needs to be portable across different operating systems like osx, irix, linux -- that said: using the "stat" command may not work well, because the arguments required to get the result i want are different on almost every operating system.
I tried to use:
cat ... | wc -c
and while this seems to work quite well, i will probably get issues in a multibyte environment, won't i? So: what's a good way to do this?