============== Common Commands
envecho $pathexport-------------cpmvmkdirrm-------------cdlsll------------- Morecattailvi--------------H
==============shell syntax
#!/bin/Bash#test1echo"Hello Shell"Echo ' Who ' echo"W.H.O."-----------------------#!/bin/Bash#t2echo"Test 2"var1=1var2=2Let var3= $var$var 1echo $var 3echo"end!"-----------------------#!/bin/Bash#t3echo"Test 3"Echo"input First integer please:"Read Var1echo"input Second integer please:"Read Var2let var3=var2+Var1echo $var 1+ $var 2 =$var 3echo"end!"-----------------------#!/bin/Bash#t4echo"Test 4"var1=$1if[$var 1-lt0]thenecho"illegal!"Fiecho"end!"-----------------------#!/bin/Bash#t5echo"Test 5"var1=$1if[$var 1-lt0]thenecho"illegal!"ElseEcho"yeah!"Fiecho"end!"-----------------------#!/bin/Bash#t6echo"Test 6"var1=$1if[$var 1-lt0]thenecho"illegal!"elif [$var 1-lt -]thenecho"fail!"ElseEcho"yeah!"Fiecho"end!"-----------------------#!/bin/Bashsum=0 for((i=1;i<101; i++) ) { let"sum+=i"}echo"sum= $sum"-----------------------#!/bin/Bash forAnimalinchcat dog pig Duck mice DoEcho $animaldone-----------------------#!/bin/Bashsum=0Echo"input Your number:"Read num while(($num >0)) Do Let"Sum+=num" Let"num--"Doneecho"sum= $sum"
Linux-shell Programming Note