I'm new to programming, and was really happy when I found out how to use an outside variable in an awk command. Now I can't figure out how to limit the responses to what I want Here's what I have:
Code:
#!/bin/bash
echo "Enter Number"
read Numb
awk '$1 ~ /'$Numb'/ {print} fromfile
The fromfile has anywhere from 1 - 100 numbered lines in $1. If Numb = 1, then it prints records for 1, and 10 - 19 as well.
How do you limit it to just the number selected?
Thanks
Zim