一、用shell脚本实现进度条#!/bin/bash
functionproc()
4{
5count=0
6bar=""
7lable=("|""/""-""\\")
8while[$count-le100]
9do
10letindex=count%4
11printf"[\033[1m\033[1;34m%-101s\033[0m][%d%%][%c]\r""$bar""$count""${lable[$index]}"
12bar=${bar}‘#‘
13((count++))
1..
分类:
系统相关 时间:
2016-06-24 20:42:42
阅读次数:
219
官方文档有句话"allows you to call any program",并且: helps you write shell scripts in Python by giving you the good features of Bash 第一句话助你在Python中轻松调用自己的程序,第二 ...
分类:
编程语言 时间:
2016-06-24 12:17:56
阅读次数:
321
#需求写一个备份脚本,用来备份samba文件保留20天#!/bin/bash
dir="/samba/operations"
backup="/data"
filename="operations.tar.bzip2"
date=`date+%Y%m%d`
[!-e"$dir"]&&echo"请联系管理员"&&exit
[!-e"$backup"]&&mkdir$backup
/bin/mkdir$backup/..
分类:
系统相关 时间:
2016-06-24 07:02:40
阅读次数:
322
nginx1.8.0安装#!/bin/bash
#installnginx-1.8.0.tar.gz
//源码包放在/usr/local/src目录下
cd/usr/local/src
tarxzvfnginx-1.8.0.tar.gz
cdnginx-1.8.0
./configure--prefix=/usr/local/nginx--with-http_realip_module--with-http_sub_module--with-http_gzip_static_modu..
分类:
其他好文 时间:
2016-06-23 19:12:04
阅读次数:
245
nginx1.8.0安装#!/bin/bash
#installnginx-1.8.0.tar.gz
//源码包放在/usr/local/src目录下
cd/usr/local/src
tarxzvfnginx-1.8.0.tar.gz
cdnginx-1.8.0
./configure--prefix=/usr/local/nginx--with-http_realip_module--with-http_sub_module--with-http_gzip_static_modu..
分类:
其他好文 时间:
2016-06-23 19:11:43
阅读次数:
189
#!/bin/bash#清除日志脚本LOG_DIR=/var/logROOT_UID=0#$UID为0的时候,用户具有root用户的权限if["$UID"-ne"$ROOT_UID"]thenecho"Mustberoottorunthisscript"exit1ficd$LOG_DIR||{#||失败的意思echo"cannotchangetonecessarydirectory">&2exit1}cat/dev/null>message..
分类:
系统相关 时间:
2016-06-23 18:59:01
阅读次数:
203
这是一种简单的工具,非常容易上手而且功能也是多种多样。 例如将整个网站打包下来的时候,看到的js代码总是混乱的,这就是类似于gulp的工具进行了加密,其他的功能还有很多这里就不赘述了。 首先是gulp的安装。 gulp的安装首先需要一个服务器,这里安装了node.js和Git Bash。将两样东西安 ...
分类:
其他好文 时间:
2016-06-22 22:02:51
阅读次数:
155
Monitoring Programs Peeking at the processes When a program runs on the system, it’s referred to as a process. To examine these processes, you need to ...
分类:
系统相关 时间:
2016-06-22 21:53:31
阅读次数:
224
#!/bin/bash##testcolorforscriptRED_COLOR=‘\E[1;31m‘GREEN_COLOR=‘\E[1;32m‘YELLOR_COLOR=‘\E[1;33m‘BLUE_COLOR=‘\E[1;34m‘PINK=‘\E[1;35m‘RES=‘\E[0m‘if[$#-eq2]thenecho"Usage:`basename$0`content{red|blue|yellow|pink|res|green}"exit1fifunctionecho_color(){case$2inr..
分类:
系统相关 时间:
2016-06-22 17:21:04
阅读次数:
226
Centos在安装Lamp或Lnmp环境时,经常会出现一些问题,提示缺少一些依赖文件,现解决方法如下:#!/bin/bash
#install_packages
yuminstall-yepel-releasewgetvim-enhanced
yuminstall-ygccgcc-c++ncurses-develperlperl-Module-Install.noarchlibxml2-developensslopenssl-de..
分类:
系统相关 时间:
2016-06-22 17:18:28
阅读次数:
785