Search Results

Search: Posts Made By: sameucho
4,098
Posted By ygemici
actually `grep -m` does not provide your req as...
actually `grep -m` does not provide your req as exactly
beacuse -m parameter gives th result your pattern at how many number in max

but i try also :)
# grep -nA 10 pattern1 file | grep -w -m1...
4,098
Posted By danmero
# cat f5 aaaa pattern2 bbbb pattern1 ...
# cat f5
aaaa
pattern2
bbbb
pattern1
ccc
pattern2
ddd
pattern1
eee
pattern2
fff
# awk '
x &&/ pattern/{print NR,$0;exit} # Step 2: If variable x has a value and second pattern...
2,095
Posted By bartus11
Setting RS to "\n\n" splits the file to records...
Setting RS to "\n\n" splits the file to records separated by empty line. Then awk checks if in any of those records is string matching regular expression placed between //, and if it matches then 5th...
2,095
Posted By radoulov
awk '!/PDP attached: 0/ { print $5 }' RS=...
awk '!/PDP attached: 0/ { print $5 }' RS= infile


Use /usr/xpg4/bin/awk or nawk on Solaris.


Edit: Sorry, just saw the OP wants only the IP ..., corrected.
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 06:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy