Hi,
I'm on AIX 5.2. I wrote a script that makes a traceroute to a host. The script works fine but each time it using the traceroute command its generate the 2 output lines.
this is the command in my script
traceroute -n -m 5 -w 2 $Host | grep 172 | awk '{print $2}' | tail -1
traceroute to XXX.XXX.XXX.XXX (XXX.XXX.XXX.XXX) from XXX.XXX.XXX.XXX (XXX.XXX.XXX.XXX), 5 hops max
outgoing MTU = 1500
XXX.XXX.172.XXX
I dont want the 2 first lines to be print out. I didn't find any switch to put the traceroute command in quiet mode... I tried this but it still printing the undesirables lines.
traceroute -n -m 5 -w 2 $Host | grep 172 | awk '{print $2}' | tail -1 > $temp_out 2>/dev/null
traceroute to XXX.XXX.XXX.XXX (XXX.XXX.XXX.XXX) from XXX.XXX.XXX.XXX (XXX.XXX.XXX.XXX), 5 hops max
outgoing MTU = 1500
cat $temp_out
XXX.XXX.172.XXX
Any idea how I can work around this issue ?