0
I am trying to write awk script to search for a pattern that is given input by user, in a file.
My code look like this:
awk 'BEGIN{printf "Enter : ";getline input<"/dev/tty"} /'"$input"'/ {print}' <abc.txt
What I get as an output is the whole file. Can someone help me to find where I'm going wrong ?
Thanks @Sándor for sorting out the error. I was pulling my hair out for this. :) – learner1 – 2016-05-02T12:22:01.043
Very welcome. I can imagine. Sometimes it quoting makes even simple cases look harder, other times it really makes them harder. – Gombai Sándor – 2016-05-02T12:27:47.293