Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1502792
  • 博文数量: 289
  • 博客积分: 11086
  • 博客等级: 上将
  • 技术积分: 3291
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-22 17:06
个人简介

徐小玉的博客。

文章分类

全部博文(289)

文章存档

2023年(6)

2022年(1)

2021年(2)

2020年(9)

2019年(9)

2018年(6)

2017年(10)

2016年(10)

2014年(3)

2013年(4)

2011年(12)

2010年(16)

2009年(14)

2008年(119)

2007年(48)

2006年(20)

我的朋友

分类: LINUX

2016-07-07 15:18:30


2: 为一列数据加但引号,逗号,并去掉空格

 awk '{print "'\''",$1,"'\''",","}' MC.txt|sed s/[[:space:]]//g>MC.txt.new

------------------------------------

1: 去掉重复行:
sort -u myl

--------------------------------------

1:判断缺少参数:
name=${1:?"requires an argument" }
echo Hello $name

2: $* and $@

The $* and $@ differ only when enclosed in double quotes. When $* is enclosed within double quotes, the parameter list becomes a single string. When $@ is enclosed within double quotes, each of the parameters is quoted; that is, each word is treated as a separate string.
只有当用双引号引用时,这两者才有区别。 "$*"会返回一个串,由所有的参数共同组成。 "$@"会分别返回各个串,每个参数都是一个独立的串。

"$*"

Expands to a single argument (e.g., "$1 $2 $3")

"$@"

Expands to separate arguments (e.g., "$1" "$2" "$3")



3: id | nawk F'[=(]' '{print $2}'
  awk 使用=或者(做为分隔符。
awk uses either an equal sign or an open parenthesis as field separator, extracts the user ID from the output

  4:The null Command 空命令
    name=Tom
   if grep "$name" databasefile > /dev/null 2>&1
    then
      :
    else
         echo "$1 not found in databasefile"
         exit 1
      fi
5: while true; do.....  可以这样紫来做判断的啊 ....  真真是....只能长叹一声,有本事你用中文自己开发个语言啊~
阅读(852) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~