Results 1 to 2 of 2
I'm debugging a shell script so I add set -x at the beginning a code snippet are as below
Code:
tcpdump -i $interface host $ip_addr and 'port 80' -w flash/flash.pcap ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-31-2012 #1Just Joined!
- Join Date
- May 2012
- Posts
- 82
shell script execution sequence
I'm debugging a shell script so I add set -x at the beginning a code snippet are as below
but I noticed that the execution sequence is as belowCode:tcpdump -i $interface host $ip_addr and 'port 80' -w flash/flash.pcap & sudo -u esolve firefox /tor_capture/flash.html & sleep $capture_time
so the execution sequence is reversed compared to the command sequence in the script what is wrong with this and how to deal with it? thanks!Code:++ sleep 5 ++ sudo -u esolve firefox /tor_capture/flash.html ++ tcpdump -i eth0 host 138.96.192.56 and 'port 80' -w flash/flash.pcap tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
- 11-01-2012 #2Linux Newbie
- Join Date
- Nov 2012
- Posts
- 134
hi,
when in background commands do not wait for the previous to be finished to start and end, so it might end before.
group commands between curly braces
Code:$ echo "bla bla bla bla bla" & echo "bla" & bla bla bla bla bla bla $ { echo "bla bla bla bla bla"; echo "bla";} & bla bla bla bla bla bla


Reply With Quote
