1

How to run a truss command with piped output?

eg.

# truss -leDo /tmp/truss.out tar cvf - dirs/ | gzip -1 > archive.tar.gz

I get only the "tar" output in truss, not from gzip!

1 Answer 1

1

Have you tried using -f ? It tells truss to follow any children the original command spawns. I'm not sure if that will work because the tar command isn't actually spawning the gzip command.

The other option that might work is:

truss -leDo /tmp/truss.tar.out tar cvf - dirs/ | truss -leDo /tmp/truss.gzip.out gzip -1 > archive.tar.gz

Again, however, I don't know if it will work but this time it's because I don't know what truss does to STDIN.

If both of those fail, you might get somewhere by using the -f option and wrapping both of them in a shell:

truss -leDo /tmp/truss.out ( tar cvf - dirs/ | gzip -1 > archive.tar.gz )

This one requires bash but it could be modified to run under other shells.

All of this is assuming that you want the tar and gzip command separate. If you don't need that, you could just use the -z option to tar to have it do the compression.

1
  • First option worked!
    – M_1
    Dec 13, 2011 at 8:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .