Skip to content

Instantly share code, notes, and snippets.

@larsr
Created May 16, 2012 08:27
Show Gist options
  • Save larsr/2708695 to your computer and use it in GitHub Desktop.
Save larsr/2708695 to your computer and use it in GitHub Desktop.
Two-line shell archive
SEP=03248902398402398402390239402
awk < $0 '/^'$SEP'/{f=substr($0,length("'$SEP'")+2);} f && !/^'$SEP'/{print $0 > f}'; exit $?
03248902398402398402390239402-file_one.txt
this is
file one
03248902398402398402390239402-file_two.txt
and this
is file
number two
03248902398402398402390239402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment