Skip to content

Instantly share code, notes, and snippets.

@snown
Created May 6, 2020 16:01
Show Gist options
  • Save snown/83caa161cb655412d6fe8ae9061c05cf to your computer and use it in GitHub Desktop.
Save snown/83caa161cb655412d6fe8ae9061c05cf to your computer and use it in GitHub Desktop.
Wrapper around printf to take in a heredoc
#!/usr/bin/env bash
function here_printf {
local format=${1:-"%b\n"}
local text
read -r -d '' text
printf "${format}" "${text}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment