Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if test "x$SHELL_VAR" = "xyes"; then
- ...
- if test $SHELL_VAR = "yes"; then
- ...
- if test $SHELL_VAR = yes; then --> if test = yes; then
- if test x$SHELL_VAR = xyes; then --> if test x = xyes; then
- if test "x$SHELL_VAR" = "xyes"; then --> if test "x" = "xyes"; then
- if test "$1" = "abc" ; then ...
- if [ "$1" = "abc" ]; then ...
- if [ -z "$SOME_VAR" ]; then
- echo "this variable is not defined"
- fi
- SHELLVAR=$(true)
- if test $SHELLVAR = "yes" ; then echo "yep" ; fi
- # bash: test: =: unary operator expected
- if test $UNDEFINEDED = "yes" ; then echo "yep" ; fi
- # bash: test: =: unary operator expected
- SHELLVAR=" hello"
- if test $SHELLVAR = "hello" ; then echo "yep" ; fi
- # yep
- SHELLVAR=" hello"
- if test "$SHELLVAR" = "hello" ; then echo "yep" ; fi
- #<no output>
- SHELLVAR=" hello"
- if test "x$SHELLVAR" = "xhello" ; then echo "yep" ; fi
Add Comment
Please, Sign In to add comment