[bash] Open and write data to text file using Bash?