shell 脚本编程
小小玮
以梦为马
展开
-
shell 练习(function,case,for,select)
#!/bin/bash square() { 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 · 1116 阅读 · 0 评论 -
shell 练习(for,while,until,local)
#!/bin/bash for variable1 in 1 2 3 4 5 do echo "Hello,Welcome $variable1 times" done for var in {1..5} do echo "index $var" done sum=0 for i in {1..100..2} do let "sum原创 2015-05-28 16:49:18 · 933 阅读 · 0 评论 -
linux shell 导出mongodb 数据库 & 导出 mysql数据库
导出mongodb 数据库到文件: dump.sh #!/bin/bash EXPORT_TOOL_PATH=/home/zjw/mongo/mongodb-linux-x86_64-2.6.1/bin/mongoexport datetime="`date +%Y%m%d`" function mk_dir() { ret=0 dirname=$1 if [ ! -d $d原创 2015-06-24 11:32:27 · 2535 阅读 · 0 评论