Jun 30, 2004 #1 frangac Technical User Feb 8, 2004 163 ZA Hi All, Below are 2 examples which I tried using, but does not seem to work. Any help. B_num=034669762523 awk -v Num1=$B_num '{if($1~/Num1/){print $0}}' or awk -v Num1=$B_num '$1~Num1{print $0}' Many Thanks Chris
Hi All, Below are 2 examples which I tried using, but does not seem to work. Any help. B_num=034669762523 awk -v Num1=$B_num '{if($1~/Num1/){print $0}}' or awk -v Num1=$B_num '$1~Num1{print $0}' Many Thanks Chris
Jun 30, 2004 #2 vgersh99 Programmer Jul 27, 2000 2,146 US if on Solaris use nawk instead of awk: awk -v Num1=$B_num '$1 ~ Num1 {print $0}' file vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+ Upvote 0 Downvote
if on Solaris use nawk instead of awk: awk -v Num1=$B_num '$1 ~ Num1 {print $0}' file vlad +----------------------------+ | #include<disclaimer.h> | +----------------------------+
Jun 30, 2004 #3 olded Programmer Oct 27, 1998 1,065 US Chris: Check out this awk faq: faq271-1281 Regards, Ed Upvote 0 Downvote
Jun 30, 2004 Thread starter #4 frangac Technical User Feb 8, 2004 163 ZA Hi All, Thanks for the replies. I had a look at a previous post and saw that PHV stated that " awk '{if($2=="'$hostname_1'")print $1}', and this did the trick. Thanks Once Again. Chris Upvote 0 Downvote
Hi All, Thanks for the replies. I had a look at a previous post and saw that PHV stated that " awk '{if($2=="'$hostname_1'")print $1}', and this did the trick. Thanks Once Again. Chris