Last active
June 19, 2016 08:31
-
-
Save tjt263/3a053aabe6ccc9cf5796 to your computer and use it in GitHub Desktop.
Just practicing some bash shell scripting; looping constructs & conditional statements.
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
_testAbc () | |
{ | |
for abc in "$(which scp)"; | |
do | |
if [[ -e "$abc" ]]; then | |
echo -e "true\n$abc"; | |
fi; | |
done | |
} | |
# _testAbc # | |
# (true| ) # | |
# (/usr/bin/scp| ) # | |
_testAbcXyz () | |
{ | |
for abc in "$(which scp)"; | |
do | |
if [[ -e "$abc" ]]; then | |
for xyz in "true" "$abc"; | |
do | |
echo "$xyz"; | |
done; | |
else | |
for xyz in "false" "$abc"; | |
do | |
echo "$xyz"; | |
done; | |
fi; | |
done | |
} | |
# _testAbcXyz # | |
# (true| ) # | |
# (/usr/bin/scp| ) # |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment