Oct 8, 2003 #1 chomps303 MIS Sep 30, 2003 83 US Why won't this work? clear echo "Enter Search String \c" read search echo "Enter Filename to Search \c" read filename fln=`awk '/$search/{printf "%d\n",NR}' $filename` echo "Line Number =" $fln Thanks Brandt
Why won't this work? clear echo "Enter Search String \c" read search echo "Enter Filename to Search \c" read filename fln=`awk '/$search/{printf "%d\n",NR}' $filename` echo "Line Number =" $fln Thanks Brandt
Oct 8, 2003 #2 Annihilannic MIS Jun 22, 2000 6,317 AU $search will not be expanded to the value of the variable because it is between single quotes. Try: fln=`awk '/'"$search"'/{printf "%d\n",NR}' $filename` Annihilannic. Upvote 0 Downvote
$search will not be expanded to the value of the variable because it is between single quotes. Try: fln=`awk '/'"$search"'/{printf "%d\n",NR}' $filename` Annihilannic.