![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux-shell和命令行学习
ycwto103
这个作者很懒,什么都没留下…
展开
-
Unit13 脚本控制
1、处理信号1.1生成信号 中断进程 Ctrl+C可以生成SIGINT信号,终止当前在shell中运行的进程; 暂停进程 Ctrl+Z可以生成SIGTSTP信号,停止当前进程,可以恢复; 备注:可以用ps au指令查看当前停止的作业,在输出结果的STAT中写着“T”的任务表示该命令正被跟踪或者已经停止。 利用kill -9 pid可以使用kill命令发送SIGKILL信号终止它。 1.2原创 2017-09-04 11:27:15 · 232 阅读 · 0 评论 -
Unit9-使用结构化命令
1、if-then语句(1) if command then commands fi (2) if command; then commands fi eg: if data then echo "it worked" fi备注:bash shell中如果命令的退出状态为0(执行成功),将执行then后面的所有指令。如果返回值非零,then后的指令将跳过。2、if-then-原创 2017-09-01 10:25:50 · 164 阅读 · 0 评论 -
Unit10 更多结构化命令
1、for命令 读取列表中的值 for var in list do ... donefor test in One Two Three do echo The next state is $test done2、C式的for命令for (( a=1; a<10; a++)) do ... done3、while命令while test command do oth原创 2017-09-01 14:55:18 · 176 阅读 · 0 评论