Skip to content

Instantly share code, notes, and snippets.

@minektur
Created June 6, 2016 20:51
Show Gist options
  • Save minektur/d96cfb90f5d0766f8052e22671f45822 to your computer and use it in GitHub Desktop.
Save minektur/d96cfb90f5d0766f8052e22671f45822 to your computer and use it in GitHub Desktop.
#!/bin/bash
LC_ALL=C
c=""
off=0
IFS=''
while read -r -N 1 c ; do
if [ ${#c} -lt 1 ]; then
# would only print when in the right range
printf "\0"
else
# would only print when in the right range
printf "%c" "$c"
fi
off=$(( $off + 1 ))
done < $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment