I have tried to search process id i-e 6762 stored in a variable say buffer
nohup tcpdump -ni eth0 -s0 2>&1
Some of the problems with the code snippet above:
Try the snippet below and see if it helps:
foreach line [split $buffer "\n"] \
{
if {[regexp {\[\d\]\s+(\d+)} $line junk pid]} \
{
break
}
}
if {[info exists pid]} \
{
puts "PID of nohup is $pid"
}