Tag: shell
Shell脚本实现网站静态化
思路简单清晰,使用curl或wget抓取页面生成静态页面,方法来自http://zhangge.net/5095.htmlDEMO:静态化sitemap.html wget http://seonoco.com/index.php/sitemap.html -O /www/seonoco.com/s ...
shell脚本报错:"[: =: unary operator expected"
报错DEMO: [root@localhost ~]# cat test.sh#!/bin/bashif [ $1 = 'noco' ] ; then echo 'yes'else echo 'no'fi[root@localhost ~]# ./test.sh./test.sh: li ...
shell脚本判断Linux是32位还是64位
下面的shell脚本函数引用自 lnmp1.2-full/include/main.shGet_OS_Bit(){ if [[ `getconf WORD_BIT` = '32' && `getconf LONG_BIT` = '64' ]] ; then Is_ ...
shell判断Linux发行版的命令
下面的shell脚本函数引用自 lnmp1.2-full/include/main.shGet_Dist_Name(){ if grep -Eqi"CentOS" /etc/issue || grep -Eq"CentOS" /etc/*-release; then DIST ...
shell脚本if表达式
无论什么编程语言都离不开条件判断。SHELL也不例外。大体的格式如下:if list thendo something hereelif list thendo another thing hereelsedo something else herefi 一个例子:#!/bin/shSYSTEM=` ...