Skip to content

Instantly share code, notes, and snippets.

@bkw777
Last active March 3, 2024 01:55
Show Gist options
  • Save bkw777/92ed6327873ef96088475bedc44e2ba5 to your computer and use it in GitHub Desktop.
Save bkw777/92ed6327873ef96088475bedc44e2ba5 to your computer and use it in GitHub Desktop.
cat without cat
# minimal example just for reference, not pointful by itself
# binary-safe read/write file without cp/cat/dd etc, pure bash, no subshell
while LANG=C IFS= read -d '' -r -n 1 x ;do printf '%c' "$x" ;done <bin1 >bin2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment