Created
March 8, 2013 19:26
-
-
Save evgeni/5119091 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/sh | |
# -n STRING | |
# the length of STRING is nonzero | |
foo="" | |
echo "expect: no output (syntax error)" | |
if [ -n "${foo}"] | |
then | |
echo "1. [ -n "${foo}"]" | |
fi | |
echo "expect: no output" | |
if [ -n "${foo}" ] | |
then | |
echo "2. [ -n "${foo}" ]" | |
fi | |
foo="true" | |
echo "expect: no output (syntax error)" | |
if [ -n "${foo}"] | |
then | |
echo "3. [ -n "${foo}"]" | |
fi | |
echo "expect: output" | |
if [ -n "${foo}" ] | |
then | |
echo "4. [ -n "${foo}" ]" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment