Created
August 26, 2014 06:39
-
-
Save liuweiathust/05cf250c9d546c3c4de8 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
#!/bin/bash | |
usage () | |
{ | |
echo Parallel sort | |
echo usage: psort file1 file2 | |
echo Sorts text file file1 and stores the output in file2 | |
} | |
# test if we have two arguments on the command line | |
if [ $# != 2 ] | |
then | |
usage | |
exit | |
fi | |
pv $1 | parallel --pipe --files sort -S512M | parallel -Xj1 sort -S1024M -m {} ';' rm {} > $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment