Last active
September 18, 2018 11:52
-
-
Save dgdavid/1873f777ab780a6d5f4a6a9acb9343cf to your computer and use it in GitHub Desktop.
Testing how to work with functions in a shell script
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 | |
function this_and_that_are_equals () { | |
this="me" | |
that="you" | |
if [ $this = $that ]; then | |
return 0 | |
else | |
return 1 | |
fi | |
} | |
echo "Working with functions" | |
echo "----------------------" | |
if this_and_that_are_equals; then | |
echo "-> this and that are the same thing" | |
else | |
echo "-> this and that are different" | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment