Skip to content

Instantly share code, notes, and snippets.

@cirosantilli
Last active August 29, 2015 13:57
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 cirosantilli/9737428 to your computer and use it in GitHub Desktop.
Save cirosantilli/9737428 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
TMP_FILE="$(mktemp)"
printf "a\n\n" > "$TMP_FILE"
[ "$(cat "$TMP_FILE" | wc -c)" = "3" ] || echo "fail file"
mapfile <"$TMP_FILE" S
if [ ! "$(printf "${S}" | wc -c)" = "3" ]; then
printf "fail var:\n$(printf "${S}" | hd)\n"
bash --version | head -n1
fi
rm "$TMP_FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment