Skip to content

Instantly share code, notes, and snippets.

@adam000
Created October 29, 2013 23:39
Show Gist options
  • Save adam000/7224692 to your computer and use it in GitHub Desktop.
Save adam000/7224692 to your computer and use it in GitHub Desktop.
How to turn a file into an array in bash (delimited by newline, if I remember correctly).
#!/bin/bash
echo "Please enter a file to be read as an array:"
read fileName
a=( $(cat fileName) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment