Skip to content

Instantly share code, notes, and snippets.

@TyeolRik
Last active May 24, 2023 01:08
Show Gist options
  • Save TyeolRik/5475c746d7d941a1056fec188f28331a to your computer and use it in GitHub Desktop.
Save TyeolRik/5475c746d7d941a1056fec188f28331a to your computer and use it in GitHub Desktop.
Function return values in Shell Script
#!/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