help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] xtrace ordering problem


From: Chris Down
Subject: Re: [Help-bash] xtrace ordering problem
Date: Sat, 28 Sep 2013 00:33:16 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On 2013-09-27 06:19, B Hope wrote:
> 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 -

The order of execution is totally arbitrary when using a pipe, because
they are all executed simultaneously.

Attachment: pgpWHU8zhYBmP.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]