Created
September 23, 2022 00:51
-
-
Save ymzkjpx/d0295e1d81fc4f545ae3c2c6b83208bb to your computer and use it in GitHub Desktop.
ShellScript改行文字テスト
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
echo '########## 単体テスト #########' | |
echo '【TEST】' | |
echo ABC #結果: ABC | |
echo $EDITOR #結果: vim | |
echo $AAA #結果: 空行 | |
echo ABC && echo $EDITOR #結果: ABC\nvim | |
echo '########### 組み合わせテスト ############' | |
echo '【TEST &&】' | |
cd ~/ABC && echo '&& suceess' | |
# 結果: ./anpatest.sh: line 8: cd: /Users/apple/ABC: No such file or directory | |
echo '【TEST ||】' | |
cd ~/ABC || echo '|| success' | |
#結果: ./anpatest.sh: line 11: cd: /Users/apple/ABC: No such file or directory\n|| success | |
echo '【TEST \】' | |
cd ~/ABC \ | |
echo '\ success' | |
#結果: ./anpatest.sh: line 14: cd: /Users/apple/ABC: No such file or directory | |
echo '【TEST \ &&】' | |
cd ~/ABC \ | |
&& echo '\ && success' | |
#結果: ./anpatest.sh: line 18: cd: /Users/apple/ABC: No such file or directory | |
echo '【TEST \ ||】' | |
cd ~/ABC \ | |
|| echo '\ || success' | |
#結果: ./anpatest.sh: line 22: cd: /Users/apple/ABC: No such file or directory\n\ || success |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment