按类别查询搜索结果
关于关键词 的检测结果,共 331
h136919934 | 2016-01-18 20:33:54 | 阅读(320) | 评论(0)
h136919934 | 2016-01-18 20:28:24 | 阅读(320) | 评论(0)
h136919934 | 2016-01-18 20:28:18 | 阅读(350) | 评论(0)
h136919934 | 2016-01-18 20:28:14 | 阅读(400) | 评论(0)
eatmyshort | 2016-01-08 11:55:30 | 阅读(14520) | 评论(0)
示例:/tomcat 目录下 tomcat进程check_tomcat.py#!/usr/bin/env python# -*- coding: utf-8 -*-import osprocess="/tomcat/tomcat.lock"        os.system("ps -ef|grep apache-tomcat-6.0.35|grep -v grep >%s" % proces...【阅读全文】
steve78926 | 2015-12-10 23:23:25 | 阅读(3020) | 评论(0)
python脚本报错【阅读全文】
douyaqiang123 | 2015-11-04 17:31:50 | 阅读(1710) | 评论(0)
huyangg | 2015-10-27 06:55:00 | 阅读(1040) | 评论(0)
chicol | 2015-10-13 23:15:28 | 阅读(990) | 评论(0)
我们可以用管道将stdout重定向到另一个命令的stdin。例如:<br />cat foo.txt | grep "test"<br />但是,有些命令只能以命令行参数的形式接受数据,而无法通过stdin接受数据流。<br />这时候xargs就派上用场了。xargs能够处理stdin并将其转换为特定命令的命令行参数。xargs也可以将单行或多行文本输入转换成其他格式,比...【阅读全文】
chicol | 2015-10-12 20:55:24 | 阅读(1040) | 评论(0)
cat可以读取、显示和拼接文件内容
1. 打印单个文件:
root@debian:/home/chicol/scripts# cat file.txt 
This is a line inside file.txt
This is second line inside file.txt
打印多个文件:
root@debian:/home/chicol/scripts# cat one.txt two.txt 
This is line ...【阅读全文】
chicol | 2015-10-12 00:33:03 | 阅读(930) | 评论(0)
条件测试语句<br />1. if条件<br />if condition;<br />then<br />&nbsp;commands;<br />fi<br />2. else if 和else<br />if condition;<br />then<br />&nbsp;commands;<br />else if condition; then<br />&nbsp;commands;<br />else<br />&nbsp;commands;<br />fi<br /><br />算数比较<br />比较条件通...【阅读全文】
chicol | 2015-10-11 22:27:23 | 阅读(1420) | 评论(0)
IFS(Internal Field Separator) 内部字段分隔符<br />1.&nbsp;<br />chicol@debian:~/scripts$ vi ifs.sh&nbsp;<br />#!/bin/bash<br /># FileName: ifs.sh<br />data="name,sex,rollno,location"<br />oldIFS=$IFS<br />IFS=, #now<br />for item in $data<br />do<br />&nbsp;echo Item: $item<br />done<br /...【阅读全文】
chicol | 2015-10-11 10:16:23 | 阅读(990) | 评论(0)
一个命令的输出可以最为另一个命令的输入,而这个命令的输出又会传递给另一个命令。这种命令组合的输出可以储存在一个变量中。<br />这些命令被称为过滤器,我们使用管道连接每个过滤器,管道操作符是|。<br /><br />1. 以两个命令的组合为例:<br />ls | cat -n &gt; out.txt<br />ls的输出被传给cat -n,后者将通过s...【阅读全文】
chicol | 2015-10-10 23:18:00 | 阅读(870) | 评论(0)
函数<br />&nbsp;1. 定义函数<br />function fname()<br />{<br />&nbsp;statements;<br />}<br />或者<br />fname()<br />{<br />&nbsp;statements;<br />}<br />函数调用很简单,使用函数名就可以调用函数<br /><br />&nbsp;2. 给函数传递参数,并由脚本进行访问<br />fname arg1 arg2 ; #传递参数<br />...【阅读全文】
chicol | 2015-10-10 22:56:21 | 阅读(750) | 评论(0)
使用Bash内建的调试工具
1. 使用选项-x,启用shell脚本的跟踪调试功能
bash -x script.sh

2. 使用set -x 和 set +x对脚本进行部分调试
set -x: 在执行时显示参数和命令
set +x: 禁止调试
set -v: 当命令进行读取时显示输入
set +v: 禁止打印输入...【阅读全文】
chicol | 2015-10-09 23:13:46 | 阅读(1040) | 评论(0)
&nbsp; &nbsp;<strong>预备知识</strong><br />在类unix系统中,日期被储存成一个整数,其大小为自<strong>世界标准时间</strong>(UTC)&nbsp;1970年1月1日0时0分0秒起所流逝的秒数。<br />这种计时方式称为纪元时或Unix时间<br /><br />&nbsp;1. 读取日期:<br />&nbsp;$ date<br />&nbsp;Fri Oct &nbsp;9 10:38:58 E...【阅读全文】
kongkong011 | 2015-09-29 11:59:11 | 阅读(2630) | 评论(0)
Linux 下编译安装 Python 3.4【阅读全文】
阳光天空201307 | 2015-09-24 11:58:26 | 阅读(4380) | 评论(0)
python调用linux命令wget实现修改远程linux机器上文件的内容【阅读全文】
ysleep | 2015-09-09 11:17:23 | 阅读(9840) | 评论(0)
想要在linux下写Python程序,作为一个Vim党,怎么能白白浪费Vim强大的功能呢,这篇文章就研究一下如何对Vim下写Python进行相关配置,欢迎大家参考【其实就只有我自己又一次把系统搞挂了再重装以后才会来参考】。【阅读全文】
Schmilence | 2015-08-24 22:29:06 | 阅读(680) | 评论(0)