Skip to content

Instantly share code, notes, and snippets.

@kg6zjl
Last active June 22, 2016 19:59
Show Gist options
  • Select an option

  • Save kg6zjl/6666defdbfcf064e49cee380fbef2b25 to your computer and use it in GitHub Desktop.

Select an option

Save kg6zjl/6666defdbfcf064e49cee380fbef2b25 to your computer and use it in GitHub Desktop.
Split a text file in half by line
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