
shell
wanxw2001
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
shell 脚本 转码目录下文件
[code="java"]#!/bin/bash #递归遍历源文件目录 function scandir(){ if [ $# -lt 3 ] then echo usage:$0 src sourcecode destcode ; exit; fi local cur_dir workdir sour...原创 2012-10-23 09:52:28 · 241 阅读 · 0 评论 -
shell 截取字符串方法集
截取字符串: 1.expr substr "$a" 1 8 2.echo $a | awk '{print substr(,1,8)}' 3.echo $a | cut -c1-8 实例: ip=`ifconfig eth0 | sed -n "2,2p" | awk '{print substr($2,6)}'`;原创 2012-10-23 17:46:57 · 173 阅读 · 0 评论 -
shell 脚本文件追踪与 debug
scripts 在运行之前,最怕的就是出现语法错误的问题了!那么我们如何 debug 呢?有没有办法不需要透过直接运行该 scripts 就可以来判断是否有问题呢?呵呵!当然是有的!我们就直接以 bash 的相关参数来进行判断吧! [root@www ~]# sh或bash [-nvx] scripts.sh 选项与参数: -n :不要运行 script,仅查询语法的问题; -v ...原创 2012-10-23 17:52:52 · 117 阅读 · 0 评论 -
shell 统计 uv 量
cat 201233.log | grep "20120816" | perl -ne '/uid=([0-9]+),/ && print "\n$1"' | sort |uniq -c |wc -l原创 2012-08-17 16:33:23 · 192 阅读 · 0 评论