- 博客(8)
- 收藏
- 关注
转载 python thread process pool
from multiprocessing import Process import os子进程要执行的代码def run_proc(name): print ‘Run child process %s (%s)…’ % (name, os.getpid())if name==’main‘: print ‘Parent process %s.’ % os.getpid()...
2018-08-21 17:28:16
324
转载 sed linux
http://man.linuxde.net/sedsed -n ‘p;n’ test.txt #奇数行 sed -n ‘n;p’ test.txt #偶数行sed -n ‘1~2p’ test.txt #奇数行 sed -n ‘2~2p’ test.txt #偶数行互换模式空间和保持缓冲区的内容。也就是把包含test与check的行互换:sed -e ‘/test/h...
2018-08-16 22:28:48
119
转载 xargs
echo `xargs<1.txt` | tr ’ ’ ‘,’ note: it is used to combine multiple lines into one line and replace space as “,”
2018-08-16 21:18:46
164
转载 linux array
#! /bin/bash firstArg=$1default_IFS=”$IFS” IFS=”,”allArg=($firstArg)IFS=”$defalut_IFS”for eachArg in ${allArg[@]}do echo $eachArg donenote: it is used to pass arg, arg, arg with $1 int...
2018-08-16 10:16:49
220
转载 python date time jSon dic
#1. def month_scope(start=None): if start is None: raise ValueError(‘start is null’) ingore_var, daysOfMonth = calendar.monthrange(start.year,start.month) firstdayOfNextMonth=...
2018-08-16 10:02:25
199
转载 linux =~ shell
#1 The =~ Regular Expression match operator no longer requires quoting of the pattern within [[ … ]].把测试条件换成下面这样就成功了。if [[ “newip"= ([0−9]1,3.)3[0−9]1,3newip"= ([0−9]1,3.)3[
2018-08-16 09:33:36
201
转载 awk process ' and "
Claim: below content is learnt from other people. 双引号:awk ‘{print “\”“}’ #放大:awk ‘{print ” \” “}’使用“”双引号把一个双引号括起来,然后用转义字符\对双引号进行转义,输出双引号。单引号:awk ‘{print “’\””}’ # 放大: awk ‘{pri...
2018-08-15 17:54:59
191
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人