![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
shell 脚本编程
小小玮
以梦为马
展开
-
shell 练习(function,case,for,select)
#!/bin/bashsquare(){ echo "Please input the num:" read num1 let "squ=num1*num1" echo "Square of $num1 is $squ"}cube(){ echo "Please input the num:"原创 2015-05-28 16:40:40 · 1122 阅读 · 0 评论 -
shell 练习(for,while,until,local)
#!/bin/bashfor variable1 in 1 2 3 4 5do echo "Hello,Welcome $variable1 times"donefor var in {1..5}do echo "index $var"donesum=0for i in {1..100..2}do let "sum原创 2015-05-28 16:49:18 · 940 阅读 · 0 评论 -
linux shell 导出mongodb 数据库 & 导出 mysql数据库
导出mongodb 数据库到文件:dump.sh#!/bin/bashEXPORT_TOOL_PATH=/home/zjw/mongo/mongodb-linux-x86_64-2.6.1/bin/mongoexportdatetime="`date +%Y%m%d`"function mk_dir(){ ret=0 dirname=$1 if [ ! -d $d原创 2015-06-24 11:32:27 · 2549 阅读 · 0 评论