shell脚本中实现脚本a里面的函数调用脚本b中的函数参数-用到source关键字
来源:互联网 发布:阿里云先知大会 编辑:程序博客网 时间:2024/06/08 17:53
##########################################################
这里就以常用的拷贝压缩为例进行实战
##########################################################
首先先写好option.sh脚本的功能
[root@localhost shell]# cat file.sh
#!/bin/bash
source /shell/option.sh
while true
do
cat <<EOF
**************************************
the following is optional *
*
**************************************
1) Copy *
2) Delete *
3) Backup *
4) Exit *
**************************************
EOF
read -p "please enter your options:" option
case $option in
1)
read -p "please input your want to copy the source file :" sdir
read -p "please input your target directory:" tdir
copy
;;
2)
read -p "Please input your target directory:" del
delete
;;
3)
read -p "please enter your backup file names:" tar_name
read -p "please enter your backup file:" tar_dir
backup
;;
4)
quit
break
;;
*)
echo "$option Is not optional operation"
esac
done
- shell脚本中实现脚本a里面的函数调用脚本b中的函数参数-用到source关键字
- shell脚本中的函数
- shell脚本里实现带参数函数的方法
- shell脚本 函数传递参数
- Shell函数和脚本参数
- shell 脚本-函数的定义和调用
- C函数调用shell脚本
- Shell脚本中的自定义函数
- Shell脚本通过参数传递调用指定函数
- Linux shell脚本中,如何定义函数及调用函数
- Shell脚本函数定义和函数参数
- shell脚本中函数的使用
- shell脚本中简单的函数示例
- shell脚本中${...}函数的用法总结
- bash脚本函数中无法访问脚本参数的问题
- 【Shell脚本学习23】Shell函数参数
- Butterfly 域脚本里面的SetSelectionList函数的 IFieldValueList 参数
- SLua 中,从一个Lua脚本调用 另一个GameObject上的Lua脚本中的函数
- React Native控件之ViewPagerAndroid讲解
- mysql基础篇---mysql查询语句干货!!!
- 杂
- 【树DP+基环树】[NOI2013]快餐店
- Openstack组件实现原理 — Nova 体系结构
- shell脚本中实现脚本a里面的函数调用脚本b中的函数参数-用到source关键字
- Spring知识点提炼
- MUI开发注意事项
- vim实用功能备忘
- 每日一题(day1)
- CF686B A - Little Robber Girl's Zoo
- 接口测试笔记1
- 动态规划之钢筋切割问题
- 一起talk C栗子吧(第一百七十三回:C语言实例--关闭终端中的缓冲功能一)