Skip to content

Instantly share code, notes, and snippets.

@jirib
Created March 7, 2021 08:20
Show Gist options
  • Save jirib/03bec20348aa730606a7088a797b2a21 to your computer and use it in GitHub Desktop.
Save jirib/03bec20348aa730606a7088a797b2a21 to your computer and use it in GitHub Desktop.
$ type foo
foo is a function
foo ()
{
echo "foo";
echo "bar";
echo "running"
}
$ status=$(foo)
$ echo ${status}
foo bar running
$ if [ "${status}" == "running" ]; then true ; else false ; fi ; echo $?
1
$ if [[ "${status}" == "running" ]]; then true ; else false ; fi ; echo $?
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment