-
-
Save zhengkai/9a58bd23088443dc2ee858f62798d3ad to your computer and use it in GitHub Desktop.
注意 >/dev/null 和 2>&1 的顺序问题
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/bash | |
>&2 echo 'stderr' | |
echo 'stdout' |
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/bash | |
./1.sh 2>&1 >/dev/null | |
./1.sh >/dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment