shell脚本(一)
2016-08-17 14:42
253 查看
1:实现shell脚本中循环调用函数
实现结果:
2:判断系统是否存在此文件
#!/bin/bash output(){ for(( num1=1; num1 <= 5; num1++ )) do echo -n "$num1 " done } let "num2=1" while [ "$num2" -le 5 ] do output echo let "num2=num2+1" done
实现结果:
2:判断系统是否存在此文件
#!/bin/bash #文件系统相关测试 fpath="/etcc/passwd" if [ -e $fpath ];then echo File exits; else echo Does not exits fi
相关文章推荐
- Yenta开发中:Shell 脚本
- shell 脚本安装MariaDB
- shell脚本编程之数组
- 在linux中执行shell脚本,当前用户执行没有问题,设置为定时任务却报错
- Shell脚本写的简单字符串hash函数
- 常用shell脚本
- 解决shell脚本中 echo 怎么写入换行到文件
- 十分钟学会写shell脚本
- Linux下Shell脚本字符串单引号、双引号、反引号、反斜杠的作用和区别
- 用shell脚本去掉源码的注释
- CentOS6、7 LVM逻辑卷分区自动扩容Shell脚本编程思路与实例
- 如何调试Shell脚本
- java调用shell脚本,解决传参和权限问题
- [shell脚本] linux shell简介
- 写一个shell脚本利用wget抓取股票历史数据
- shell脚本:一键优化centos系统
- shell 脚本
- 改进版本的压缩和解压的shell脚本
- shell中,依次向同一脚本中传递不同的参数
- shell脚本每天自动备份mysql数据库