L
liadsh
Guest
Hey,
i have this script (just the beggining)
read porta
read portb
#awk -F ' ' '{print $1,$2}' /var/log/tmp_num.txt&
echo "<$porta,$portb>"
grep -Fx "<$porta,$portb>" /var/log/table.def.temp
if [ "<$porta,$portb>" = 'grep -Fxq "<$porta,$portb>" /var/log/table.def.temp' ]
then
echo "exist"
else
echo "does not exist"
fi
the file contains the following:
{ <4500,17>, <500, 17>, <259, 17>, <1701, 17>, <5500, 17>, <68,17>, <67,17>};
{ <4500,17>, <500, 17>, <259, 17>, <1701, 17> };
what i'm trying to do is, lets say i enter 68 as porta and 17 as portb, match this sintax in the /var/log/table.def.temp file and then use it in the if loop. i saw in a few articles that grep -Fxq should catch only a specific word but it doesn't catch anything.
after this is accomplished i will add other stuff and not just echo.
thanks
i have this script (just the beggining)
read porta
read portb
#awk -F ' ' '{print $1,$2}' /var/log/tmp_num.txt&
echo "<$porta,$portb>"
grep -Fx "<$porta,$portb>" /var/log/table.def.temp
if [ "<$porta,$portb>" = 'grep -Fxq "<$porta,$portb>" /var/log/table.def.temp' ]
then
echo "exist"
else
echo "does not exist"
fi
the file contains the following:
{ <4500,17>, <500, 17>, <259, 17>, <1701, 17>, <5500, 17>, <68,17>, <67,17>};
{ <4500,17>, <500, 17>, <259, 17>, <1701, 17> };
what i'm trying to do is, lets say i enter 68 as porta and 17 as portb, match this sintax in the /var/log/table.def.temp file and then use it in the if loop. i saw in a few articles that grep -Fxq should catch only a specific word but it doesn't catch anything.
after this is accomplished i will add other stuff and not just echo.
thanks