ls is a file and directory listing tool.  In unix there are 20 different ways to do the same thing.  Chose one - when it works you are done.

The only thing I really care about is that I look at the attribute and it says 1024 (in M) and the test says 1024M.

So sure Lopaka your solution gets rid of one grep call and makes the test so much better.  I'll use it.

Per dd - when I was working with the national storage labs via ampex to benchmark and verify tape/disks on many different computer, disk and file systems the file sizes created with the same dd command were not identical across systems.  They did vary by a few K.