Hi tcpdump-workers, how to call tcpudmp rightly in the sh script with tcpdump expression(filter)? something confused me a lot. The following call is wrong: ------------------------------------------------------------------
#!/bin/sh parameters=" -s 96 \'ip host 192.168.0.80\'" tcpdump $parameters -n -w /opt/nec/wbmc/tcpdump/file.tmp [r...@test tcpdump]# ./s.sh tcpdump: WARNING: eth0: no IPv4 address assigned tcpdump: syntax error ------------------------------------------------------------------ while i call this command directly in the shell terminal,message as the following can be seen: [r...@test tcpdump]# tcpdump -t -s 96 'ip host 192.168.0.80 ' -n -w /opt/nec/wbmc/tcpdump/file.tmp tcpdump: WARNING: eth0: no IPv4 address assigned tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes tcpdump -s 96 'ip host 192.168.0.80 ' -n -w /opt/nec/wbmc/tcpdump/file.tmp It seems it runs normally: [r...@test ~]# !ps ps aux| grep tcpdump pcap 28708 1.5 0.5 4688 1044 pts/3 S+ 07:41 0:00 tcpdump -t -s 96 ip host 192.168.0.80 -n -w /opt/nec/wbmc/tcpdump/file.tmp Thanks, Li JingXiang E-Mail: l...@nec-as.nec.com.cn ================================================= - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.