shell编程笔记一

#!/bin/bash
#print hello world in the console window
a="Hello,World"
echo "A is:" $a

赋值符号左右两边不能有空格,否则语法错误。

 

num=2

echo "this is ${num}d"

用{}将变量名括起来,起到确定变量名的作用

 

获取命令行参数总数 $#

 

后台执行,模拟多进程 

#!/bin/bash
rsync .... &
rsync .... &
...

posted @ 2013-05-03 15:46  践道者  阅读(235)  评论(0编辑  收藏  举报