shell
多多是小坏熊
这个作者很懒,什么都没留下…
展开
-
linux shell脚本学习笔记(2)
1. for命令 for var in list do commands done for test in monday tuesday wednesday thursday friday saturday sunday do echo the test is $test done wang@wang:~$ ./test.sh the test is monday the test is tuesday the test is wednesday the test is thursday the原创 2020-09-18 20:51:23 · 61 阅读 · 0 评论 -
linux shell脚本学习笔记
1. if-then语法 if command then commands fi if后面的命令,执行后状态码返回0,则执行then部分的命令 if pwd then echo "then" else echo "else" fi 2. if-thenz只能测试命令退出码,如果测试其他条件,可用test命令 if test condition then commands fi val="hello" if test $val then echo "return true" else ech原创 2020-09-12 16:58:32 · 188 阅读 · 0 评论