Skip to content

Instantly share code, notes, and snippets.

@mattmc3
Created January 3, 2024 03:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattmc3/8ad82f9b4937ef0f4e806ccecc37cb18 to your computer and use it in GitHub Desktop.
Save mattmc3/8ad82f9b4937ef0f4e806ccecc37cb18 to your computer and use it in GitHub Desktop.
convert piped input to args
# convert piped input to args
if [[ ! -t 0 ]] && [[ -p /dev/stdin ]] && (( $# == 0 )); then
set -- "${(@f)$(cat)}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment