“Linux-2018-spring-6-12”的版本间的差异
跳到导航
跳到搜索
| 第40行: | 第40行: | ||
$nohup bash run0.sh &:后台运行run0.sh | $nohup bash run0.sh &:后台运行run0.sh | ||
| + | |||
| + | 1、[http://hlt.suda.edu.cn/index.php/Linux-2018-spring-run0.sh run0.sh函数] | ||
| + | 2、[http://hlt.suda.edu.cn/index.php/Linux-2018-spring-run1.sh run1.sh函数] | ||
| + | 3、[http://hlt.suda.edu.cn/index.php/Linux-2018-spring-run2.sh run2.sh函数] | ||
| + | 4、[http://hlt.suda.edu.cn/index.php/Linux-2018-spring-run3.sh run3.sh函数] | ||
*C语言中的多维矩阵 | *C语言中的多维矩阵 | ||
[http://hlt.suda.edu.cn/index.php/Linux-2018-spring-main main.c函数] | [http://hlt.suda.edu.cn/index.php/Linux-2018-spring-main main.c函数] | ||
2018年6月19日 (二) 07:54的最新版本
一、复习内容
- shell中变量的定义
注意变量两边不能有空格
- 复杂语句
- shell脚本(求和的例子)
#!/bin/bash
sum=0
for((i=1;i<101;i=i+1)); do
sum=$(($i+$sum))
done
echo $sum
二、新内容
- shell脚本的运行方式
1、bash x.sh
2、chmod +x x.sh
./x.sh
- “#!/bin/bash ”的作用
1、告诉shell文件类型,打开或解释或运行的方式
2、告诉shell用那种shell运行文件。
- shell中函数的定义和使用
$# -----参数的个数 $* -----字串 $0 -----第0个参数 $1 -----第1个参数 $@ -----数组 $? -----获取返回值
- 命令行参数
$nohup bash run0.sh &:后台运行run0.sh
1、run0.sh函数 2、run1.sh函数 3、run2.sh函数 4、run3.sh函数
- C语言中的多维矩阵