shell
蒙--
这个作者很懒,什么都没留下…
展开
-
shell 运行shell脚本
1. hello world#!/bin/bashecho "Hello World !"#! 是一个约定的标记,它告诉系统这个脚本需要什么解释器来执行,即使用哪一种 Shell。echo 命令用于向窗口输出文本。2. 运行shell1、作为可执行程序chmod +x ./test.sh #使脚本具有执行权限./test.sh #执行脚本注意,一定要写成 ....原创 2018-12-25 10:28:57 · 190 阅读 · 0 评论 -
shell 获取当前日期时间
curdate="`date +%Y-%m-%d,%H:%M:%S`";echo $curdate; 参考:https://www.cnblogs.com/OliverQin/p/5865656.html转载 2018-12-25 11:45:25 · 3315 阅读 · 0 评论 -
shell 获取时间及如果应用进程不存在时启动
#! /bin/bash curdate="`date +%Y-%m-%d,%H:%M:%S`"; echo $curdate; log="/home/wwwroot/rundeck/start.log"; stillRunning=$(ps -ef |grep "rundeck-launcher-2.6.7.jar" |grep -v "grep"); if ["$stil...原创 2018-12-25 13:02:48 · 260 阅读 · 0 评论 -
shell 传递参数
http://www.runoob.com/linux/linux-shell-passing-arguments.html以下实例我们向脚本传递三个参数,并分别输出,其中$0为执行的文件名:#!/bin/bash# author:菜鸟教程# url:www.runoob.comecho "Shell 传递参数实例!";echo "执行的文件名:$0";echo "...转载 2019-04-11 22:03:55 · 126 阅读 · 0 评论 -
shell 脚本执行报错/bin/bash^M: bad interpreter: No such file or directory
sheff脚本执行报错/bin/bash^M: bad interpreter: No such file or directory解决方法:因为脚本在windows下创建编辑然后上传到linux系统的,所以是dos格式的,而linux却是只能执行格式为unix格式的脚本。所以识别不了,检查一下是否是dos格式:vi编辑模式下,输入 :set ff 然后回车回车后:确定...转载 2019-06-06 14:35:51 · 3048 阅读 · 1 评论 -
shell unzip,zip
#! /bin/bash#脚本参数#$1:母包路径 $2:渠道包路径 $3:ipa包名 $4:渠道号if [ $# == 0 ];thenecho '##{"msg":"缺少参数", "code":255}##'exit 0fi#定义变量ipapath=$1destpath=$2ipaname=$3agentid=$4#母包完整路径, 带文件名ppacka...原创 2019-06-06 17:19:42 · 1253 阅读 · 0 评论