I am trying to write a simple bash file able to capture Wi-Fi traffic that looks like this:
STRING1="tshark -i 2 -a duration:5 -w <path of output.pcap>"
$STRING1
echo "'Wi-Fi' captured"
STRING2="tshark -r <path of output.pcap> -T fields -e frame.number -E header=y > <path of output.csv>"
echo $STRING2
$STRING2
The first command STRING1 is correctly processed and output.pcap is created. When STRING2 is launched i get the error tshark: Syntax error.. But if I just copy and paste the STRING2 command in the terminal everything works fine.
What am I missing here?