Last active
May 24, 2023 01:08
-
-
Save TyeolRik/5475c746d7d941a1056fec188f28331a to your computer and use it in GitHub Desktop.
Function return values in Shell Script
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
#!/bin/bash | |
function all_uppercase() { | |
local ret=${1^^} # Make input parameter Upper case. Should be declared in local variable. | |
echo "$ret" # This is like return. | |
} | |
SomeString="HelloWorld" | |
UpperCase=$(all_uppercase "${SomeString}") | |
echo $UpperCase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment