Created
March 22, 2016 21:37
-
-
Save bukzor/17dbe08ac1adb2926121 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simulate two slowly-running batch jobs: | |
slow() { | |
# print stdout at 10bps | |
pv -qL 10 | |
} | |
timestamp() { | |
# prefix stdin with a sortable timestamp | |
tai64n | |
} | |
seq 99 | slow | timestamp > seq.1 & | |
seq 100 199 | slow | timestamp > seq.2 & | |
# I'd like to see the combined output of those two logs, in timestamp-sorted order | |
# This gets the job done, but waits till both jobs have stopped: | |
sort -sm seq.1 seq.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment