Hello Experts,
I am newbie in UNIX shell scripting. I am more of an application administrator but I find shell scripting very good specially for automation of some stuff. I hope my question is valid.
I am having trouble with AWK command, I never thought this 3 letter command will have that complexity.
My logic is to pass a variable as an FNR value in awk
Code:
#!/usr/bin/sh
cFile1=`wc -l ${File1}|awk '{print$1}'`
echo "`awk -v m=${cFile1} 'FNR == m {print $1}' ${FILE1}`"
However, the "echo" part of the code seems not working. Is there anyone who can help me on this?
Thank you so much in advance! :-)