Chinaunix首页 | 论坛 | 博客
  • 博客访问: 567029
  • 博文数量: 213
  • 博客积分: 6789
  • 博客等级: 准将
  • 技术积分: 1947
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-01 17:11
文章分类

全部博文(213)

文章存档

2012年(9)

2011年(62)

2010年(99)

2009年(43)

分类: LINUX

2011-03-04 18:23:17

cut:
       cut -bn-m:以byte为单位,从第n个byte开始,取m个
  cut -bn,m:以byte为单位,截取第n,m个byte
  cut -b-n,m:以byte为单位,截取1-n,和第m个
  -c:以charactor为单位
  -d:指定分隔符,默认为tab
  -s:使标准输入中没有delimeter
  cut -f1:截取第1个域

DESCRIPTION
       Print selected parts of lines from each FILE to standard output.

       Mandatory arguments to long options are mandatory for short options too.

       -b, --bytes=LIST
              select only these bytes

       -c, --characters=LIST
              select only these characters

       -d, --delimiter=DELIM
              use DELIM instead of TAB for field delimiter

       -f, --fields=LIST
              select only these fields;  also print any line that contains no delimiter character, unless the -s option is specified

       -n     (ignored)

       --complement
              complement the set of selected bytes, characters or fields

       -s, --only-delimited
              do not print lines not containing delimiters

       --output-delimiter=STRING
              use STRING as the output delimiter the default is to use the input delimiter

       --help display this help and exit

       --version
              output version information and exit

chechunli@chechunli-PC:~ # cat cut.sh 
#!/bin/bash
TEST=`echo $1 | cut -b9-15`
echo "$TEST"

chechunli@chechunli-PC:~ # ./cut.sh 1234567890
90
chechunli@chechunli-PC:~ # ./cut.sh 1234567890123456789
9012345

阅读(659) | 评论(0) | 转发(0) |
0

上一篇:notification apk

下一篇:word 快捷键

给主人留下些什么吧!~~