Skip to content

Instantly share code, notes, and snippets.

@jpluscplusm
Last active August 22, 2016 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpluscplusm/7cb3c7018f1caf215d83baee062e51b4 to your computer and use it in GitHub Desktop.
Save jpluscplusm/7cb3c7018f1caf215d83baee062e51b4 to your computer and use it in GitHub Desktop.
AWK invocations for ASCII-delimited operation
#!/bin/bash
# ASCII-delimited input and output
awk -vFS="\x1F" -vRS="\x1E" -vOFS="\x1F" -vORS="\x1E" "$@"
#!/bin/bash
# ASCII-delimited input
awk -vFS="\x1F" -vRS="\x1E" "$@"
#!/bin/bash
# ASCII-delimited output
awk -vOFS="\x1F" -vORS="\x1E" "$@"
@ashb
Copy link

ashb commented Aug 22, 2016

\x30 is 0 - you want -vOFS="\x1F" -vORS="\x1E"

@jpluscplusm
Copy link
Author

Dammit, that does explain something odd I was seeing :-) Nice catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment