4 Fix text about what the first test actually does.
source | link

The problem with first example is that you are testing the exit code ofwhether the string that echo command which is always 0 (true in the shell language)returns has non-zero length. One solution to this problem is to evaluate tested expression:

TEST="! -e ~/bin/xyz"
if eval "[ $TEST ]"; then
   echo running "$TEST";
fi

Notice, that brackets are inside eval, because [ is a command, so we evaluate this command together with variable $TEST as its argument.

The problem with first example is that you are testing the exit code of the echo command which is always 0 (true in the shell language). One solution to this problem is to evaluate tested expression:

TEST="! -e ~/bin/xyz"
if eval "[ $TEST ]"; then
   echo running "$TEST";
fi

Notice, that brackets are inside eval, because [ is a command, so we evaluate this command together with variable $TEST as its argument.

The problem with first example is that you are testing whether the string that echo returns has non-zero length. One solution to this problem is to evaluate tested expression:

TEST="! -e ~/bin/xyz"
if eval "[ $TEST ]"; then
   echo running "$TEST";
fi

Notice, that brackets are inside eval, because [ is a command, so we evaluate this command together with variable $TEST as its argument.

3 Rollback to Revision 1
source | link

The problem with first example is that you are testing the exit code of the echo command which is always 0 (true in the shell language). One solution to this problem is to evaluate tested expression:

TEST="! -e ~/bin/xyz"
if $(eval "[ $TEST ]");]"; then
   echo running "$TEST";
fi

Notice, that brackets are inside eval, because [ is a command, so we evaluate this command together with variable $TEST as its argument.

The problem with first example is that you are testing the exit code of the echo command which is always 0 (true in the shell language). One solution to this problem is to evaluate tested expression:

TEST="! -e ~/bin/xyz"
if $(eval "[ $TEST ]"); then
   echo running "$TEST";
fi

Notice, that brackets are inside eval, because [ is a command, so we evaluate this command together with variable $TEST as its argument.

The problem with first example is that you are testing the exit code of the echo command which is always 0 (true in the shell language). One solution to this problem is to evaluate tested expression:

TEST="! -e ~/bin/xyz"
if eval "[ $TEST ]"; then
   echo running "$TEST";
fi

Notice, that brackets are inside eval, because [ is a command, so we evaluate this command together with variable $TEST as its argument.

2 added 3 characters in body
source | link

The problem with first example is that you are testing the exit code of the echo command which is always 0 (true in the shell language). One solution to this problem is to evaluate tested expression:

TEST="! -e ~/bin/xyz"
if $(eval "[ $TEST ]";]"); then
   echo running "$TEST";
fi

Notice, that brackets are inside eval, because [ is a command, so we evaluate this command together with variable $TEST as its argument.

The problem with first example is that you are testing the exit code of the echo command which is always 0 (true in the shell language). One solution to this problem is to evaluate tested expression:

TEST="! -e ~/bin/xyz"
if eval "[ $TEST ]"; then
   echo running "$TEST";
fi

Notice, that brackets are inside eval, because [ is a command, so we evaluate this command together with variable $TEST as its argument.

The problem with first example is that you are testing the exit code of the echo command which is always 0 (true in the shell language). One solution to this problem is to evaluate tested expression:

TEST="! -e ~/bin/xyz"
if $(eval "[ $TEST ]"); then
   echo running "$TEST";
fi

Notice, that brackets are inside eval, because [ is a command, so we evaluate this command together with variable $TEST as its argument.

1
source | link