Created
April 18, 2011 18:05
-
-
Save SeanPlusPlus/925822 to your computer and use it in GitHub Desktop.
reads lines from a file and echos those lines to your terminal
This file contains 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 | |
# | |
# ReadFromFileWriteToArray.sh | |
# | |
# pass a file as a param to this command | |
declare -a listOfThings | |
i=0 | |
while read line ; do | |
listOfThings[$i]=${line} | |
echo ${listOfThings[$i]} | |
i=$i+1 | |
done < $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment