Thanks very much for all the useful replies. It seems obvious in hindsight :)
--- address@hidden wrote:
From: "B Hope" <address@hidden>
To: <address@hidden>
Subject: [Help-bash] xtrace ordering problem
Date: Fri, 27 Sep 2013 06:19:05 -0700
Hello,
Apologies if you get this e-mail twice.
I am using "set -x" to debug a shell script. On a single core VM I get the debug output (the lines beginning "+ ") reversed. The script ends with the same result. Should the order of the output when using "-x" always be the same?
$ cat b.sh
#!/bin/bash
/usr/bin/tail -n 100 messages | /bin/grep blah | md5sum
$ bash -x b.sh
+ md5sum
+ /usr/bin/grep blah
+ /usr/bin/tail -n 100 messages
hsdhdfhdfhdfhfhdfh -
Morgan Marine Insurance Services
Established Leading Marine Insurance Providers
Competitive Premiums & Discounted Scheme Rates for Motorboats, Jetskis, Yachts, Commercial Vessels, Ribs, Marine Trade Policies. We insure them all!
No obligation quotes and instant cover. http://www.morganmarineinsurance.com
Cut your mobile bill by 30% in 30 seconds at http://energylinx.co.uk/calc_powerswitch.html?db=dual&referId=e-mile
For cutting edge website design visit: http://www.swivuk.co.uk