
shell
文章平均质量分 77
iteye_11231
这个作者很懒,什么都没留下…
展开
-
shell 脚本
赋值过程中,等号两边无[b]空格[/b]。获取进程号,并杀死进程:PID=`ps gaux | grep test.sh | grep -v grep | awk '{print $2}'`; kill -9 $PID;数学运算,需要 expr 命令add=`expr $newTotal - $oldTotal`;判断文件是否存在:if [ -f $file...2012-09-11 15:51:17 · 101 阅读 · 0 评论 -
shell 语法基础知识
一、基本语法1.1、shell文件开头shell文件必须以下面的行开始(必须方在文件的第一行): #!/bin/sh 符号#!用来告诉系统它后面的参数是用来执行该文件的程序。在这个例子中我们使用/bin/sh来执行程序。 当编辑好脚本时,如果要执行该脚本,还必须使其可执行。 要使脚本可执行:运行chmod +x filename 这样才能用./filename 来运行...2012-09-11 16:09:59 · 139 阅读 · 0 评论 -
shell example.
#!/bin/sh#=============================================================================# Author : Gareth Liao# Desc : runMonitorInquireIncrease.sh# Run: sh runMonitorInquireIncrease.sh I...原创 2012-09-27 15:56:30 · 134 阅读 · 0 评论 -
文件备份
#!/bin/sh# $1 is the path to the files# $2 is the prefix of the archive# $3 is the which day ago to archive# exampleFILE_PATH=$1PREFIX=$2DAYS=$3cd $FILE_PATH/bin/ls -lrt $FILE_PA...2012-09-28 12:44:37 · 103 阅读 · 0 评论