Not to worry. It's common with newcomers.
Although I would've put the ending tag after the last line of
code instead of the end of the post.
A couple more things to comment on:
You can usually use redirections instead of cat when accessing file contents. In this case you can use:
Personally, I don't like using set/shift with the positional parameters. I prefer to use arrays instead. Bash v.4 even has a new
mapfile built-in that makes it easy to load lines from a file into an array.
Code:
mapfile -t arr <crpage #-t removes the trailing newline
#or for earlier versions of bash:
#IFS=$'\n'
#arr=( $(<crpage) )
echo "${arr[0]}" #you should generally quote variable expansions
echo "${arr[1]}" #especially when they can contain spaces
echo "${arr[14]}" #and other shell-reserved characters
There's no need to fool with IFS this way either (at least, not with v.4). The only thing you have to remember is that arrays are 0-indexed, so you need to subtract one from each line number to reference it.
(Or mapfile also has an
-O option, which lets you set the index start number to whatever you want.)