We shouldn't make sloppy tests just because you think that the `stat` command is a "pain".

First of all, there is no reason whatsoever to use `grep` twice:

```bash
ls -l --block-size=M /mnt/ephemeral/swapfile
```

Also, there is no need for this test to be human readable, it is a test not a log message.

The `stat` command has a large set of options, one of them is an output format; which has an option for outputting just the size of the file in bytes. You can find all of this in the manual for `stat`.

As for having to use `bc` or something to use math, `bash` has arithmetic expansion already so there is no need to call out to `bc`.

The test should be:

```bash
test `stat --format=%s /mnt/ephemeral/swapfile` -eq $((1024 * 1024 * 1024))
```