首页 > 代码库 > ubuntu shell编程笔记

ubuntu shell编程笔记

and 命令

if  [   A  -a   B ]

then

else

fi

 

set command

set  these are parameters

$1

set

 

strings

str="A is a"

echo "$str"

 

a=30 b=15
echo `expr a + <script id="MathJax-Element-1" type="math/tex">a + </script>b`
echo `expr a - <script id="MathJax-Element-2" type="math/tex">a - </script>b`
echo `expr a \* <script id="MathJax-Element-3" type="math/tex">a \* </script>b`
echo `expr a / <script id="MathJax-Element-4" type="math/tex">a / </script>b`
echo `expr a % <script id="MathJax-Element-5" type="math/tex">a % </script>b`

 

The Internal Field Separator

IFS=: 

set ":" as field separator S1:S2:...