Skip to content

Instantly share code, notes, and snippets.

@mojaveazure
Created February 9, 2017 18:25
Show Gist options
  • Save mojaveazure/4031eb8a6019364ea69f8d2b53354287 to your computer and use it in GitHub Desktop.
Save mojaveazure/4031eb8a6019364ea69f8d2b53354287 to your computer and use it in GitHub Desktop.
Read a file into an array without using `cat`
#!/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