Created
December 5, 2022 03:58
-
-
Save robfrawley/329c22b30a14195a9eb4d154fed43518 to your computer and use it in GitHub Desktop.
Bash Function Supporting Both Passed Values and Piped Input
This file contains hidden or 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
#!/usr/bin/env bash | |
lowercase() | |
{ | |
# Grab input. | |
declare input=${1:-$(</dev/stdin)}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment