1. 判断一文件是不是块或字符设备文件,如果是将其拷贝到 /dev 目录下
read -p "input a file:" filename
if [ -b $filename -o -c $filename ]
then
cp $filename /dev/
fi
2.编写一个脚本,进行简单的减法运算,要求提示输入变量
#!/bin/bash
read -...
分类:
系统相关 时间:
2014-06-24 20:59:09
阅读次数:
434
今天偶然想到去更新一下机子里面PHP的版本,然后重新去wamp官网下载了WAMP(wamp 64 Apache : 2.4.9 MySQL : 5.6.17 PHP : 5.5.12 PHPMyAdmin : 4.1.14 SqlBuddy : 1.3.3 XDebug : 2.2.5)。
安装之后修改 D:\wamp\bin\mysql\mysql5.6.17\my.ini,发现修改了dat...
分类:
数据库 时间:
2014-06-24 20:52:46
阅读次数:
244
从bin/flume 这个shell脚本可以看到Flume的起始于org.apache.flume.node.Application类,这是flume的main函数所在。
main方法首先会先解析shell命令,如果指定的配置文件不存在就甩出异常。
根据命令中含有"no-reload-conf"参数,决定采用那种加载配置文件方式:一、没有此参数,会动态加载配置文件,默认每30秒...
分类:
编程语言 时间:
2014-06-24 17:13:22
阅读次数:
387
#!/usr/bin/envpython#Filename:helloworld.py#Theuseof‘and"print‘hello,world!‘print"hello,world!"#Theuseof‘‘‘and"""print‘‘‘Thisisamulti-linestring.Thisisthefirstline.Thisisthesecondline."What‘syourname?"Iasked.Hesaid"Bond,JamesBond."‘‘‘print"""Thisisamulti-li..
分类:
编程语言 时间:
2014-06-24 17:05:23
阅读次数:
239
raw_input()python内建函数将所有输入看做字符串,返回字符串类型input()对待纯数字输入时具有自己的特性,它返回所输入的数字的类型(int,float)input()本质上还是使用raw_input()来实现的,只是调用完raw_input()之后再调用eval()函数例子:#!/usr/bin/envpythonthis_year=2..
分类:
编程语言 时间:
2014-06-24 16:57:50
阅读次数:
297
要求,输入name不为空,输入次数最多3次,3次后跳出程序;知识点:raw_inputstr转intwhilifelifelsecontinuebreakfor导入模块引用变量值格式化输出vim#!/usr/bin/envpython
importsys
user_name="carson"
this_year=2014
counter=0
whileTrue:
ifcounter<3:
name=raw_input(..
分类:
其他好文 时间:
2014-06-24 16:52:27
阅读次数:
290
#vimpost-commit#!/bin/bash
REPOS="$1"
REV="$2"
SVNLOOK="/usr/bin/svnlook"
echo"`date+%F`">>/tmp/post.log
echo"REPOS=$1REV=$2">>/tmp/post.log
echo-e"\$@=$@#">>/tmp/post.log
echo-e"`date+%F`end\n">>/tmp/post.log
$SVNLOOKchanged"$REPOS..
分类:
其他好文 时间:
2014-06-24 16:38:56
阅读次数:
282
yum是RPM的前端工具,通过yum命令可以帮我们自动解决安装rpm包之间的依赖关系。下面是搭建本地yum仓库的步骤:1、挂载光盘(光盘为CentOS-6.5-x86_64-bin-DVD2.iso)mount/dev/cdrom1/medials一下/media这个目录,可以看到以下内容2、创建本地文件夹,将Packages下的rpm包全部..
分类:
系统相关 时间:
2014-06-24 16:18:22
阅读次数:
304
检查HP服务器内存状态脚本脚本1(如有问题则发邮件通知):#vidisk.sh按a或i进入编辑模式#!/bin/bashName=`hostname`Date=`date+%m%d%y`Num=`dmidecode|grep-i‘serialnumber‘|head-n1`Mem=`/sbin/hpasmcli-s"showdimm"|grepStatus|awk-F[:""]+‘{print$2}‘‘`#echo$Diski=1;forOK..
分类:
其他好文 时间:
2014-06-24 16:11:12
阅读次数:
293
#!/bin/bash
#
#Time:2014-06-23
#Author:ftlynx
#Function:useNET-SNMPgetNICtrafficonnagios.
Usage(){
echo"Usage:check_traffic.sh[options]"
echo" -H HostIP."
echo" -P net-snmpcommunitystring."
echo" -N NICName."
echo" -W nagioswarningvalue.Format:200,300..
分类:
移动开发 时间:
2014-06-24 16:10:35
阅读次数:
224