I have some code as shown below. The problem is, is that there are multiple occurrences of the pattern i am using. I was wondering if there is any way to make awk only execute on the first occurence of the pattern so it is not being duplicated in the file ?
Any help is appreciated
Thanks
for Server in $Serverlist; do
f2="$(<$1)"
awk -vf2="$f2" '/Server N.*1p/{print f2;print;next}1' $Server > tmp
mv tmp $Server
done