tcpdump + IFS = no sense?



Ok, perhaps one of the experts here can help. I'm just trying to write
a small script that will start a tcpdump. The dump will be started
with a variable for tcpdump's parameters. This works fine:

cmd="-i eth0"
tcpdump $cmd

BUT, if I then add an IFS command before it (to eventually allow me to
read the parameters from a config file) it doesn't work. This fails:

IFS="
"
cmd="-i eth0"
tcpdump $cmd

with a "tcpdump: ioctl: No such device"

I've tried it with Redhat EL3 and FC5 with the same results. Can
someone explain what the heck's going on?

Thanks!
Tony

.



Relevant Pages

  • Re: em0, VLAN and bpf(?) trouble w/RELENG_5
    ... As soon as I stop the tcpdump, ... cmd 0x03, sap aa ui/C len=39 ...
    (freebsd-current)
  • Re: tcpdump + IFS = no sense?
    ... a small script that will start a tcpdump. ... tcpdump $cmd ... What are you setting IFS to? ... internal field separator ...
    (comp.os.linux.networking)
  • Re: Network traffic capture, and rotating files with compression
    ... >> writing to make it log to file, stop, compress then carry on in a new ... > First write a script that wraps up the starting and stopping of tcpdump. ... > should send a SIGINT to the process and remove the pid file. ...
    (comp.os.linux.networking)
  • Re: how to rotate a tcpdump file
    ... Therefore you're going to have to wrap tcpdump in a script to test the size ... restart tcpdump with a new dump file. ... depending on what data you're capturing there might be a really simple ... simply capturing 154202 packets will give you a 10MB dump file. ...
    (freebsd-questions)
  • Questions about perl daemons with child processes and open files / signals
    ... running as daemon which launch a child process. ... I need to run a perl script as a daemon. ... tcpdump output, but I decided to use a pipe ... parent process, thinking it would automatically ...
    (comp.lang.perl.misc)