tiny refactoring for more idiomatic bash

- `-r` does the same as `-e` but also checks if file is readable
- always use `$( )` for subshells