command invocation

Hello,

I've tested something like this: tcpdump -r /tmp/out.out > /tmp/out.ra 2> /dev/null

works fine - there is no status message visible.

if I place in a bash-script this line: $(tcpdump -r /tmp/out.out > /tmp/out.ra 2> /dev/null)

I get status information on executing :confused:. I also tried to assign result to var - doesn't work.

  1. How does 'tcpdump' knows if script or user manually typed in command?
  2. How to suppress these status lines I get from tcpdump when calling from script?

thanx in advance..

When you are calling tcpdump from your script , just exclude the parenthesis .
only place the below

tcpdump -r /tmp/out.out > /tmp/out.ra 2> /dev/null

Thanks, but it doesn't work like expected.

I get some output lines from 'tcpdump' e.g.: "reading from file /tmp/..., link-type EN10MB (Ethernet)"