Last active
June 22, 2016 19:59
-
-
Save kg6zjl/6666defdbfcf064e49cee380fbef2b25 to your computer and use it in GitHub Desktop.
Split a text file in half by line
This file contains hidden or 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
| f=$"download.sh"; s=$(wc -l $f | awk '{print $1}'); \ | |
| h=$(echo "scale=0;" $(($s/2+1)) | bc -q); \ | |
| split -l $h $f "output_"; for file in output_*; \ | |
| do mv "$file" "$file.sh"; done; \ | |
| for f in output_*.sh; do bash $f & done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment