Created
June 2, 2014 15:10
-
-
Save tmuth/63b964a6dc76e4daa6bb to your computer and use it in GitHub Desktop.
Split a text file every n number of lines
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 | |
# parameter 1: file to split | |
# parameter 2: number of lines per file | |
echo "About to split file $1" | |
echo "every $2 lines" | |
md5sum $1 > $1.md5 | |
split -l $2 $1 $1.split. | |
gzip -1 $1.split.* | |
md5sum $1.split.*.gz > $1.split.gz.md5 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment