starting tshark with given parameter from bash script [closed]
Hello, I am launching tshark with the following cmd line on a RPi with Debian Jessie without any problem:
tshark -i "eth0" -f "port 8000" -w /tmp/x.pcap
Now I want to pack this in a bash script called shark0 so that inexperienced users can take captures and send me the file.
The script looks like that:
#!/bin/sh
shark="tshark -i "'"eth0"'" -f "'"port 8000"'" -w /tmp/x.pcap"
echo $shark
$shark &
Unluckily this script only opens the tshark options manual, thus I suppose something must be wrong with the parameters. When I copy the output of the echo $shark line to the command prompt, tshark executes normally. I have installed tshark the default way, answering the window that pops up with "YES" and adding user pi to the group:
sudo usermod -a -G wireshark pi
And I am not running the script as root!
Thx for advice
@administrator : Thank you for re-shaping my text.
This isn't a Wireshark problem, but is a bash scripting issue. You should use an appropriate support forum for bash issues, e.g. a Stack Exchange question here.
absolutely right. But you pointed me in the right direction. Thx