linux shell学习(一)第一个hello world
来源:互联网 发布:行知实践园自己感受 编辑:程序博客网 时间:2024/05/18 20:07
#!/bin/bash#we have less than 3 arguents# $#表示命令行参数的个数if [ $# -lt 3 ];then # $*表示命令行参数 echo $* elif [ $# -eq 3 ];then echo $*elif [ $# -gt 3 ];then echo $*fi# file是在命令行参数中的循环for file in $*; do # 判断file是否是目录中存在的文件 if [ -f "$file" ]; then echo $file is exsit #如果有两个参数,那么改名字 if [ $# -eq 2 ];then mv "$1" "$2" fi fidone
结果:
rongtao@rongtao:~/shell$ sh Demo.sh Hello World !Hello World !rongtao@rongtao:~/shell$
阅读全文
0 0
- linux shell学习(一)第一个hello world
- 第一个shell程序:hello world
- 第一个shell 脚本------ hello world
- Linux驱动开发学习 第一个驱动程序 hello world
- Linux设备驱动程序,个人学习,第一个模块hello world
- Swift学习笔记(一)——我的第一个Swift程序 Hello World
- dubbo学习教程(一):完成入门第一个hello world程序【基于zookeeper】
- nodeJs初接触(一)第一个程序代码hello world!
- RabbitMQ (一)第一个hello world
- linux驱动学习(2)-第一个驱动程序hello world
- linux(ubuntu)下的第一个程序 hello world
- linux 第一个内核模块Hello World
- linux 第一个内核模块Hello World
- Linux第一个驱动:Hello World
- 入门Linux,第一个Hello world程序
- 驱动程序学习笔记(1):第一个驱动程序 hello world
- python学习(三)第一个hello world程序
- ios学习笔记(二)第一个应用程序--Hello World
- Nginx入门
- 两个textarea文本框上下间距调整及inline-block间距
- c++-字符串排序-冒泡排序
- openFileDialog和saveFileDialog组件
- RStudio入门教程(二)RStudio数据处理
- linux shell学习(一)第一个hello world
- MyBatis_01_HelloWorld
- 多线程共享变量
- uva 227
- 自定义注解(spring)
- 周中训练笔记+Educational Codeforces Round 34 (Rated for Div. 2)
- 【EasyUI】datagrid相关操作、弹窗windows
- 【pandas】[3] DataFrame 数据合并,连接(merge,join,concat)
- 好像不写博客就不是好的程序员