I am trying to get a specific line from a text file.
So far, online I have only seen stuff like sed, (I can only use the sh -not bash or sed or anything like that).
I didn't particularly like any of the answers.
Here is how I did it.
# Convert the file into an array of strings lines=(`cat "foo.txt"`) # Print out the lines via array index echo "${lines[0]}" echo "${lines[1]}" echo "${lines[5]}"