Skip to content

Instantly share code, notes, and snippets.

@tjt263
Last active June 19, 2016 08:31
Show Gist options
  • Save tjt263/3a053aabe6ccc9cf5796 to your computer and use it in GitHub Desktop.
Save tjt263/3a053aabe6ccc9cf5796 to your computer and use it in GitHub Desktop.
Just practicing some bash shell scripting; looping constructs & conditional statements.
_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