Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
grep using variables
Name: Malcs72 Date: May 15, 2003 at 04:38:00 Pacific OS: Unix CPU/Ram: p3
Comment:
Can anyone help with using grep to search a file for a string stored in a variable.
ie x=20:30 grep $x filename
It works fine when I can manually use the hard code, but I require the use of a stored value. grep 20:30 filename.
Summary: Hi, I was trying to pass variable search strings inside AWK and use it as START and END criteria. This is how it goes. Within shell script declare START and END as START_POINT="This is the Starting Po...
Summary: Hi my script is to collect the duplicate records in the file. the script is as follows. sort -t, -k 1,1 -k3,6 datafile.csv | awk -F, 'BEGIN { getline holdline=$0 holdkey=$1$3$4$5$6 ...
Summary: I am trying to extract lines after a grep command this is what i have so far /sbin/chkconfig --list | grep 'xinetd based services' there is about 20 lines after the grep that i need, it may not alw...