sandeepmur
Programmer
Hi,
I have the fwg code :
my problem is that I want to print "HELLO" only when grpName is found as it is in name variable. In the above code, if i leave out 'c' in grpName, it still prints HELLO.
any suggestions ?
thnx
I have the fwg code :
Code:
grpName="abc"
name="SBL|ttt|abc"
echo $name | awk -v g=$grpName 'index($1,"|"g)!=0 { print "HELLO"}'
my problem is that I want to print "HELLO" only when grpName is found as it is in name variable. In the above code, if i leave out 'c' in grpName, it still prints HELLO.
any suggestions ?
thnx