Created
January 3, 2024 03:15
-
-
Save mattmc3/8ad82f9b4937ef0f4e806ccecc37cb18 to your computer and use it in GitHub Desktop.
convert piped input to args
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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