Created
February 9, 2017 18:25
-
-
Save mojaveazure/4031eb8a6019364ea69f8d2b53354287 to your computer and use it in GitHub Desktop.
Read a file into an array without using `cat`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
MY_FILE="$1" | |
declare -ax ARRAY=($(<"${MYFILE}")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment