This may seem trivial, but I am trying to figure out how I can display a certain line in a file. I have been doing:
set myLine = 2
cat -n MyFile |grep $myLine[^0-9] | awk -F " " '{print $2}'
the cat -n numbers the lines in the file
the grep looks for a line that is specified in myLine
the awk just prints out the second column
But, it doesnt work
I am doing this in a C-shell script. If I take out the variable and put in the number 2, it will work. It does not like the variable. Any help would be greatly appreciated. Thanks.
Mike