Archive

Author Archive

${str=expr}和${str:=expr}区别

June 19th, 2008 admin No comments

在第5页,看来很多人对${str=expr}和${str:=expr}还不是很明白,以下是它们的具体解释,这回大家应该能完全理解了。

   $ str=      # 設為 null
   $ var=${str=expr}   # 定義 var
   $ echo $var
   
   $ echo $str
   
   $ unset str   # 取消
   $ var=${str=expr}   # 定義 var
   $ echo $var
   expr
   $ echo $str
   expr

${str=expr}
若$str没设定,则expr作为返回值,同时将$str赋值为expr。否则以$str的值作为返回值。
${str:=expr}
若$str没设定或为null,则expr作为返回值,同时将$str赋值为expr。否则以$str的值作为返回值。

* 两者在 not set not null 都一致
*
但当 null 值时,${str=expr}会将 $var $str 都设为 null ,但${str:=expr}则设为 expr

Categories: Unix Tags:

2008欧洲杯主题曲Enrique Iglesias – Can You Hear Me

June 18th, 2008 admin No comments

 

Artist:Enrique Iglesias
Song:Can You Hear Me

I remember that I can still feel you
Sometimes I’m blind but I see you
You are here but so far away
The times when you wanna.. Im missing you
Makes me feel like I’m spinning
Sometimes you get what you gain

Read more…

Categories: Music|音乐, Soccer Tags:

wound its way

June 17th, 2008 admin No comments

★wind v. 蜿蜒
wind one’s way 蜿蜒而行
The road winds its way.

The stream wound its way across the field and then flowed right under their tent! (新概念英语第二册笔记新版Lesson 27:A wet night雨夜)

Categories: English|英语 Tags:

awk文本处理总结(入门,中级,高级) ZT

June 17th, 2008 admin No comments

 awk处理文本总结 – Alex.Wang            2008-2-19 15:55
http://kai0200.cublog.cn/ 转载请保留以上信息谢谢!

    作为技术支持工程我们最最经常的工作就是经常碰到要处理文本文件,不管是什么数据库最后都可以导成文本,我们就可以对他进行处理了,这样即使你不是对所有数据库操作都很熟悉也可以对他的数据进行处理了。
    我们必须的工具有两个一个是shell一个是awk,awk对于处理文本文件是最最适合的掌握了awk我们就可以很方便的处理文本文件再借助一些shell命令我们可以很方便得到自己想要的结果。现在从简单的例子来总结一下我觉得会经常碰到的问题。
   
    awk入门篇
   
    awk入门,文本内容example1.txt.
   
user1 password1 username1 unit1 10
user2 password2 username2 unit2 20
user3 password3 username3 unit3 30   

    在unix环境中我们可以使用一下命令来打印出第一列
   
[root@mail awk]# awk ‘{print $1}’ example1.txt

    得到的结果是如下,解释一下”‘{” 单引号大括号包含awk语句是为了和shell 命令区别,$1的意思就是文本文件的第一列,正常的awk命令跟随-F参数指定间隔符号,如果是空格或tab键就可以省略了。
  Read more…

Categories: Unix Tags:

“千方百计”和“争分夺秒”英语怎么说

June 16th, 2008 admin No comments

1. leave no stone unturned (to do sth)

means: try every possible means; to try one’s best, to make every effort.千方百计;想方设法。
据说:

传说波斯与希腊曾大战于普拉特亚(Plataea)城。波斯将军玛多尼斯(Mardonius)战败溃逃。消息传出说玛多尼斯曾经在扎营的地方埋下大批奇珍异宝。有个名叫波力克雷兹(Polycrates)的人,闻讯后便去寻宝。但找了好久,仍然一无所获。他跑到特尔菲(Delphi)城的神殿去问神,后按照神谕,把每块石头都翻遍,终于找到了珍宝。这个短语还可以写作:leave not any stone unturned或者 No stone was left unturned。

请看例句:

They left no stone unturned in their search for the child’s mother.他们千方百计寻找孩子的母亲。

We’ll leave no stone unturned to accomplish the great task.为了完成这一件伟大的任务,我们将会千方百计。
I am doing extensive research and I don’t want to leave any stone unturned.我正在进行扩展研究,为此我将想尽一切办法。

To find the book I wanted Cindy left no stone unturned in the bookstore.为了找到我想要的那本书,Cindy把书店翻了个遍。

2. every second counts

means: every second is important.每一秒都很重要,争分多秒,一寸光阴一寸金啊。

关于这个count,记得电影《泰坦尼克号》的结尾处Jack和Rose在冰冷的海水中,身体僵硬的Jack对坚持不下去的Rose说:Make everyday count.(惜时如金。)

请看例句:

The time of life is short. So, now every second counts.生命是短暂的,从现在开始我们必须争分多秒。

The examination is just round the corner. From now on, every second counts!考试即将来临,从现在起惜时如金。

Categories: English|英语 Tags: