Re: tcpdump + IFS = no sense?
- From: tony.andreoli@xxxxxxxxx
- Date: 29 Aug 2006 10:09:10 -0700
I'm setting it to a carriage return:
IFS="
"
As I've done a million times before. The result is the ability to read
a text file one line at a time rather than one word at a time. That
functionality still works fine, it's just that tcpdump is choking.
Dale Dellutri wrote:
On 29 Aug 2006 08:49:46 -0700, tony.andreoli@xxxxxxxxx wrote:
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?
bash can't parse the command string properly because you changed the
field separator. What are you setting IFS to?
$IFS
internal field separator
This variable determines how Bash recognizes fields, or word
boundaries when it interprets character strings.
$IFS defaults to whitespace (space, tab, and newline), but may be
changed, for example, to parse a comma-separated data file. Note that
$* uses the first character held in $IFS. See Example 5-1.
--
Dale Dellutri <ddelQQQlutr@xxxxxxxxxxxx> (lose the Q's)
.
- Follow-Ups:
- Re: tcpdump + IFS = no sense?
- From: David Schwartz
- Re: tcpdump + IFS = no sense?
- References:
- tcpdump + IFS = no sense?
- From: tony . andreoli
- Re: tcpdump + IFS = no sense?
- From: Dale Dellutri
- tcpdump + IFS = no sense?
- Prev by Date: Re: tcpdump + IFS = no sense?
- Next by Date: Re: Failover router ?
- Previous by thread: Re: tcpdump + IFS = no sense?
- Next by thread: Re: tcpdump + IFS = no sense?
- Index(es):
Relevant Pages
|