Created
February 2, 2022 23:17
-
-
Save joeljuca/24ccc07fcbd416b84abc56c4cb39e188 to your computer and use it in GitHub Desktop.
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
function number-only() { | |
if test ! -t 0; then | |
strlen "$(</dev/stdin)" | |
else | |
echo -n $@ | | |
xargs | | |
sed -E "s/[^0-9]+//g" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment