grep on specific line of the file

Hi,

how can we search for a word (with case ignore )on specific line numbers

ex:

Awk /^regEX/ with condition on first line or second line

Awk/^ regex1/ on line 1

Awk /^regEX2/ on line 3

thanks in advance

For the second line:

/^regEX/ && NR==2

Regards

thank you, here how can we search with ignore case using awk' /^test/' ?

To find out about a particular line, say the 4th line of xx lines:

cat myfile | head -4 | tail -1 | grep -i "test"

OK, not very elegant, but a way to return info about a specific line of text in a file. :rolleyes:

 awk 'toupper($0) ~ /^TEST/{do your suff here..}' file