From 70f503595eff433f82ff7f32eb6bee080902ac06 Mon Sep 17 00:00:00 2001 From: JamesonHuang Date: Sat, 4 Jul 2015 13:09:00 +0800 Subject: [PATCH] edit shell_demo --- 1_2.mind_map/1_6.the_shell_programing.xmind | Bin 0 -> 24544 bytes 1_3.test_code/sh_test/sh_demo.sh | 135 ++++++++++++++++++++ 1_3.test_code/sh_test/test.sh | 3 - 3 files changed, 135 insertions(+), 3 deletions(-) create mode 100644 1_2.mind_map/1_6.the_shell_programing.xmind create mode 100644 1_3.test_code/sh_test/sh_demo.sh delete mode 100755 1_3.test_code/sh_test/test.sh diff --git a/1_2.mind_map/1_6.the_shell_programing.xmind b/1_2.mind_map/1_6.the_shell_programing.xmind new file mode 100644 index 0000000000000000000000000000000000000000..a69cc4327200d88658b32dfda6be1497d677d11d GIT binary patch literal 24544 zcmeIa2Ut_f);|n(#d1`NiWEVbl+Z&9CJCGwjCU43H&#+2mS%SijfM4@sp^1 zr%n1MDItS~nqg6BNeNXmJE)|d3h99zB|v(T68e&Syh0KneMt$>x0}*t7Pc@n z$`NTPgF*ltFv|(Z3CaP*e}6*)^b=_isU?y(l@1@_=UtxUA}1qb1Kv0PQo z(p@G-EZhzXsFs~Qpm%}-LZZB2VN!Pk3imsm!B|6~SVp)dgb9qmAVh_1p*C;}J{vnH zUOO`|8Y{wY>tF+rvxeFM3c9C?mQX7*M+A27C%7d^mHwtWNeL{<9&WK$fgloWjc~w1 z?NC@KTmS~gLSZl{3SnvCL>dNYM+>YY8p>^fFv9?v4~P`#V?cv>9N|1bXYn{9&CL*I zNDHXt-&Y66BA}95)=)-GYbXN2coU6+q0In7FbNQL@16woHlRVIF^Q4QC{oChAAxod5I~`YYz3@rMQyQ`JoZS~p49gG7LeYTJ_as+@c!ku z|NP#U-Uaj=7{P!7epPSK-jD{U{)};ZD63`{*1~;|jEo(4|24`U15g%&bwNNedmzh6 z(MkMoK=uo%zs15hV()VgqWCS~B2XtATWdSCkev|L z7G?%uot?RWkR1~v5-_R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HZ2#|`GX)C5l~dX#sV3`?@)VUJv4pdYULL@29VtG{#x_DU6AC8 zBF>8l%$!_=P?P=A+8azt0rLz5vY6G{#qjR@QvD55{_DU_v$yR-x(HqR4?C_0$jETP z-P3mS6%>0;FPxmrfhb8@09s!>4Gc8}gVd7zx>dmK7WIa$06y`#7q4Dy19S_OmcKi? zawk*ADkPouw|MM-9|S|x12I6M!16BX;0Z{kz_kC|jklZr?(A~!$!?!M7opbX?<7O0 zyasrSlaBnrYNp)#&4B~{L=k@YD9fWNav~YPd2(5f2#$gF*4amZhYooA8^msQ@xwf0 zw@T+5WI7`x*ocR`kh01|BB)|XB4DJ6az573Xxc>A0{ft*p zq9)U)fY$tGyWsZnkgyhrj7$x9|2Wj+_nWAwfTvVswXSh1sLBC{)ga-($x2^N%#}D$ zwe=q!9`lXP-)@NdR%mZSl%xc3q#cx-bX<}Pqm?59!3~^G1sogr^LZmozd415be74# ze&$~sy7?Q5a62;?6!i5h&Oaypb?4oe6IXsd69)_I{sGSRLHspW--Y~7oALdDZ-V+y zY9*bT{GU9h@qGvBKV|pF6Mu6&(f=qhU_Z*ApWgFx$NY7N{3C`*b^OWJ!T;%Yd^yfd?dr~Nnol>MI``OTJ{-#-7Faq}HR_BL{&Mr3BM0mefDc;8ea-$zOI z<2>}A&+#UmhyL5wH^u$^Q$L?e3+#jb>17UV!1-x>{{F$A585J~NA%p4=Ph8rtx1;o->B(NhS~3H`q`wBwv_#NePsXZ4Q9Wm^0QKs f%-@ffuijr6!<$M6N!|k4QQ)r}@K;V6lfL~wq9HTf literal 0 HcmV?d00001 diff --git a/1_3.test_code/sh_test/sh_demo.sh b/1_3.test_code/sh_test/sh_demo.sh new file mode 100644 index 0000000..7e9d021 --- /dev/null +++ b/1_3.test_code/sh_test/sh_demo.sh @@ -0,0 +1,135 @@ +#!/bin/bash +#以下代码中(())可替换为[] + + +#-------------------------------------- +echo "var define" + +var="helo" #定义变量不需加$ +echo ${var} #使用变量时加$ +echo "---------------------------" +echo "" + +#-------------------------------------- +echo "echo about str" + +#单引号中任何字符均原样输出 +#单引号里不能出现单引号(使用转义符也不行) +single_str='helo' + +#双引号里可以有变量 +#双引号里可以出现转义字符 +double_str="hello,\" ${single_str} \" " +echo $single_str +echo $double_str +echo "---------------------------" +echo "" + +#-------------------------------------- +echo "字符串连接:" +#字符串连接 +#method 1 +echo "method1: ","helo", "helo" + +#method 2 +str="strcat" +str2="helo" +echo "method2: ${str},${str2}" + +#method 3 +echo "method3:" ${str} ${str2} +echo "---------------------------" +echo "" + +#-------------------------------------- +echo "get strlen:" +echo "strlen: ", "${#str}" +echo "---------------------------" +echo "" + +#-------------------------------------- +echo "substr:" +substr="hello Meizu!" +echo ${substr:1:4} +echo "---------------------------" +echo "" + + +#-------------------------------------- +echo "查找子串: error" +echo 'expr Meizu "${substr}"' +echo "---------------------------" +echo "" + +#-------------------------------------- +echo "for sh format:" + +for((i=0; i<10; i++)) do + echo $i +done +echo "---------------------------" +echo "" + +#-------------------------------------- +echo "if-else:" +min=10 +max=10 +if ((${min} < ${max})); then + echo "min < max" +elif ((${min} > ${max})); then + echo "min > max" +else + echo "min = max" +fi +echo "---------------------------" +echo "" + +#-------------------------------------- +echo "while" +var=10 +while ((${var} > 0)); do + var=$((var-1)) + echo $var +done +echo "---------------------------" +echo "" + +#-------------------------------------- +echo "执行shell命令,将结果赋给变量:" +#var=`date` +var=$(date) +echo $var +echo "---------------------------" +echo "" + +#-------------------------------------- +echo "echo不换行:" +# -e 开启转义 \c 不换行 +echo -e "OK! \c oo" +echo "---------------------------" +echo "" + +#-------------------------------------- +echo -e "前台运行shell:\t\c" +ls +echo "后台运行shell:" +ls & +echo "---------------------------" +echo "" +#-------------------------------------- +echo "/dev/null:" +echo "helo" > /dev/null +echo "---------------------------" +echo "" + +#-------------------------------------- +echo '$?:' +ls +echo $? +echo "---------------------------" +echo "" + +#-------------------------------------- +echo HELLO'X' +echo "---------------------------" +echo "" diff --git a/1_3.test_code/sh_test/test.sh b/1_3.test_code/sh_test/test.sh deleted file mode 100755 index e05cf1d..0000000 --- a/1_3.test_code/sh_test/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -ps -echo "hello world"