Skip to content

Instantly share code, notes, and snippets.

@jesusgoku
Created July 25, 2020 03:14
Show Gist options
  • Save jesusgoku/f296d399e0eaa652bcfaf970acbae89a to your computer and use it in GitHub Desktop.
Save jesusgoku/f296d399e0eaa652bcfaf970acbae89a to your computer and use it in GitHub Desktop.
Read from stdin with bash
#!/usr/bin/env bash
# while read line; do
# echo "${line}"
# done < "${1:-/dev/stdin}"
# cat "${1:-/dev/stdin}"
# cat <&0
# cat -
cat "${1:-/dev/stdin}" > "${2:-/dev/stdout}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment