[bash] How to read from a file or STDIN in Bash?