Thursday Apr 30, 2009

Tip: Different master pty regards between Solaris and Linux

转载时请以超链接形式标明文章原始出处和作者信息
http://blogs.sun.com/weixue/entry/tip_differece_master_pty_regards

During investigation Opensolaris bug 6824625. The root cause is the different result of calling tcsetattr() for pty on Solaris and Linux.
Solaris and Linux treat slave pty differently.
For opening pty (Pseudo Terminal), there have two steps, open master device and slave device sequently. On Solaris, master pty device is not regarded as a terminal device. it regard slave device as a terminal device only.
But On Linux(I tested on Ubuntu), both master and slave devices are regarded as terminal devices.

So, tcsetattr() can work for both master and slave device on Linux. But, tcsetattr() can only work for slave pty device on Solaris. You can also use isatty() to tests if file descriptor is associated with terminal device .

It's a useful tip for porting terminal application between Solaris and Linux.

A piece of code for your reference, how to open pty: You can see that ioctl() only apply to slave device on Solaris(in macro #ifdef __sun).

FYI.

The Open Group Base Specifications : General Terminal Interface.
Concept of pty, tty..(in Chinese)

Friday Apr 24, 2009

Which terminal emulator do you need?

转载时请以超链接形式标明文章原始出处和作者信息
http://blogs.sun.com/weixue/entry/which_terminal_emulator_do_you

During doing many terminal(emulator) evaluation, I found there are so many terminal emulator. And most of these support i18n feature. That means you can use it to display of input international languages character. Currently, the goal of evaluation is to weight which terminal should be high priority to be integrated in Opensolaris. Of course, there are some terminal emulator are not be listed. such like iterm, fbterm. If you need, I'll add them. Please see FOSS terminal evaluation. Hope you could leave comment to let me know which terminal is you favorate and which terminal you would like to be integrated in Opensolaris.

Your comments would be appraciated. Btw, if any xi18n support terminal I haven't listed , please let me know!.Thanks!

Friday Mar 20, 2009

How to complile fetion for pidgin on OpenSolaris 在Opensolaris上编译飞信

转载时请以超链接形式标明文章原始出处和作者信息
http://blogs.sun.com/weixue/entry/how_to_complile_fetion_for

在Opensolaris上使用pidgin这个即时通信客户端,可以支持很多的协议。但是国内流行的QQ和飞信在最新官方的Opensoalris发布版里都没有加入这两个协议的支持。本文讲述如何在pidgin中使用飞信的扩展。这里是编译好的飞信扩展libfetion.so,(感谢SunYong同学编译的release版:))下载后放到 /usr/lib/purple-2 目录下,重新启动pidgin即可。

下面说说如何自己动手编译飞信fetion,首先在Opensoalris中搭建编译环境,可参考这篇文章。(如果你觉得这篇难看懂,就把Sunstudio装上先,然后装下列包pkg install ss-dev SUNWxwinc SUNWxorg-headers SUNWgnome-common-devel SUNWperl-xml-parser SUNWiconv-unicode SUNWiconv-extra SUNWgit SUNWgm4 SUNWgnu-gettext SUNWperl-xml-parser SUNWGlib SUNWgnu-automake-110 SUNWaconf

编译的步骤:

下载 fetion protocol,将fetion目录整个拷贝到:
../libpurple/protocols

修改:
../libpurple/protocols/Makefile.in and Makefile.am
在DIST_SUBDIRS中增加fetion

修改:
configure.ac,
照着qq的位置加入fetion

编译:
aclocal
autoconf
automake -a -f -c

./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --disable-binreloc --enable-gnutls=no --with-nss-includes=/usr/include/mps --with-nss-libs=/usr/lib/mps --with-nspr-includes=/usr/include/mps --with-nspr-libs=/usr/lib/mps --enable-gnome-keyring --enable-gevolution --enable-cap --disable-meanwhile --disable-nm --disable-consoleui --with-perl-lib=vendor --disable-nss CC=/opt/SUNWspro/bin/cc CXX=/opt/SUNWspro/bin/CC

make


Thursday Mar 19, 2009

Cannot login ssh -X between Opensolaris and S10

It reported in Opensoalris forums that "Problem with b108 and ssh -X". Because Opensoalaris already move to Xorg's X window component, so the X fonts naming style of S10 is not compatibility with it. So, when you login to remote S10 machine from locale Opensolaris, you may see message like:
> font missing: KSC5601.1992-3 for Window
> font missing: TIS620.2533-0 for Window
> font missing: ISO8859-6 for Window
> font missing: ISO8859-8 for Window
> font missing: SUN.UNICODE.INDIA-0 for Window


Please use Opensolaris/lastest Nevada as remote machine to avoid the error.
Also, when I run
ssh -X S10_machine -l account /usr/bin/gnome-terminal
error message is showed as following.
The program 'gnome_segv' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadValue (integer parameter out of range for operation)'.
  (Details: serial 255 error_code 2 request_code 148 minor_code 3)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)


I'm not sure the reason, it looks also because of incompatibility.

Thursday Feb 05, 2009

由fontconfig 到CSS

在学习fontconfig的配置的时候看到介绍,fontconfig的配置格式解析算法使用的是css2 (Cascading Style Sheets)。自然就计入CSS的主页看了,发现这个专业自动提供很多语言的翻译,其中自然还有中文的CSS主页。这下对于不喜欢读英文的朋友可以说是个福音了。
重叠样式表 (CSS) 是一种为 Web 文档添加样式(例如字体、颜色和边距)简单机制。
举个例子,假如在一个页面或整个网站中,要求凡是标题都为  H1  、黑体字及蓝色,正文则为  4  号字、宋体及黄色,这是一种风格,也即  "  样式  "  ,通过样式表来实现这种风格。  具体的内容大家自己看吧。


The current Fontconfig matching algorithm was inherited from Xft; it was designed to provide a
mechanism similar to cascading style sheets but without actually studying and duplicating that
specification. As the differences are minor, and essentially unwarranted, the matching algorithm in
Fontconfig will be changed to make performing CSS2-style matching more convenient.
There are aspects of CSS2 which Fontconfig cannot perform, in particular, it has no context in which to
interpret terms like “bolder”, “larger” or “wider”. These must still be interpreted by the application.
However, the weight fill-in and slant substitution specifications can easily be replicated, and the relative
weight operators can be handled with some application assistance.
The resulting matching mechanism will be useful wherever CSS2 is used, and also provide a more
accessible specification as developers and users become comfortable using the CSS2 font specification
mechanisms.

Sunday Jan 18, 2009

如何让xterm 显示中文

默认安装好Xorg的xterm后,如果使用默认的配置很多中文的显示都是小方框,也就是无法显示。有2个方法可以暂时解决这个问题,不过都不是特别完美,只不过通过修改配置,或者改变了字号。估计是默认的点阵字体不全的原因,只有默写字号有比较全的字体(GB2312)。

方法1:
修改:/etc/X11/app-defaults/XTerm 中:
\*VT100.utf8Fonts.font:  -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1 
->  \*VT100.utf8Fonts.font5:  -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
\*VT100.utf8Fonts.font5: -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
->  \*VT100.utf8Fonts.font: -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
或者直接指定字体启动xterm:
xterm -fn -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1

方法2:
1、编辑 ~/.Xresources 文件,加入
        xterm\*faceName:AR PL Uming CN
        xterm\*faceSize:12
2、执行  xrdb -load .Xresources
3、重启 xterm,问题解决了。

方法3:
1、编辑 ~/.Xresources 文件 :
    XTerm\*font: -misc-fixed-medium-r-normal-\*-18-120-100-100-c-90-iso10646-1
    XTerm\*wideFont: -misc-fixed-medium-r-normal-\*-18-120-100-100-c-180-iso10646-1
2、执行  xrdb -load .Xresources
3、重启 xterm,问题解决了。

 

Saturday Nov 15, 2008

HMM(Hidden Markov Model) 隐马尔可夫的学习小结

前段时间学习了一下隐马尔可夫模型,这里做了一个简单总结,把隐马尔可夫那些事做个罗列,一来以后复习也有个头绪,二来为将要学习的人做个提示吧。
马尔可夫有两个重要的基本原理:    

  • 有限视野
  • 时间不变性 

具体的内容请自行查阅,这是整个HMM的前提。

隐马尔可夫模型 HHM:
一般模型: 五元组(S, K, Π, A, B)
S: 状态集
K: 输出字母表(其实就是观测结果集合)
Π: 初始状态概率
A: 状态转移概率
B: 符号发射概率

HMM的三个基本问题
  1>已知模型参数μ = (A, B, π),计算某个观测序列发生的概率,即求P(O|μ)
    向前向后算法 Forward-backward algorithm.
  2>给出观测序列O和模型μ,怎样选择一个状态序列X(X1,X2,...XT+1),能最好的解释观测序列O
    Viterbi算法 (http://en.wikipedia.org/wiki/Viterbi_algorithm)
  3>给出观测序列O,寻找最可能的状态转移以及输出该序列的概率
    Baum-Welch算法 (http://en.wikipedia.org/wiki/Baum-Welch_algorithm)

参考资料:
http://en.wikipedia.org/wiki/Hidden_Markov_model
Forward Algorithm: http://www.comp.leeds.ac.uk/roger/HiddenMarkovModels/html_dev/forward_algorithm/s1_pg7.html

Monday Oct 20, 2008

看自然语言处理需要知道的一些数学基础

要看统计自然语言处理下面的一些数学内容是要知道的。这里只把他们列出来,并没有写实际内容,这需要你自己看了。:)


1. 概率空间
  概念:
  样本空间Ω    , 概率函数P, 事件集合即事件的σ-field
  必然事件Ω={ω1,ω2,ω3} / 基本事件: {ω1},{ω2},{ω3}.
  事件体σ-field:={Ω,φ,{ω1},{ω2},{ω3},
      {ω1,ω2},{ω1,ω3},{ω2,ω3},{ω1,ω2,ω3}}
            注意:1). 在σ-field中对至多可列次的集合的并、交及求余运算都是封闭的.
                    2). 事件是样本空间的子集而是事件体的元素(点),因此对任一事件A,有A?Ω,而A∈?.
  性质:
  1>P(Ω) = 1
  2>可加性:对于不相交的集合

2.条件概率
    基本概念:
    条件概率:P(A|B) = P(A∩B)/P(B)
    成法律: 当(B)!=0,有  P(A∩B) = P(B)P(A|B) = P(A)|P(B|A)
    推广到多事件的情况,链式规则。2个事件独立。

3.贝叶斯定理
4.随机变量
5.期望值和方差
    期望值是一个随机变量的各个取值得平均值.
    方差,
6.联合分布和条件分布
7.概率函数P的估计
8.标准分布
9.贝叶斯统计

Friday Apr 25, 2008

服务器标准性能评估

在看到服务器性能评估的数据时,经常会看到SPECxxx这样的术语,这个是什么意思呢?

首先SPEC是 Standard Performance Evaluation Corporation (标准性能评测公司)的缩略写。它是一个非营利性的组织。目标是公平,公正的统一基准的评测经算计算性能。详细信息请看Wiki的介绍。 知道这个之后,就不难理类似这样SPECint2006 SPECfp2006的术语了,它们其实就是不同的评测方面的基准指标。最广泛使用的UNIX服务器性能基准测试包括以下四项:

SPECint2006——衡量业务应用中常用的整数计算吞吐量;
SPECfp2006——衡量科学应用所需要的浮点计算吞吐量;
SPECjbb2005——衡量每秒业务运行的Java性能;
TPC-C——衡量交易处理能力

通常对CPU,内存,和编译器的性能评测主要就是看前两项。所以再你看很多编译器比较时,通常比较的就是这两项指标。


Sunday Jan 13, 2008

Indian language - Hindi font

When you hear language about some country, probably you will think the one-one relationship like:

China - Chinese

Japan - Japanese

England - English

...

But for Indian, it's special. For Indian , it does not means certain language. It means many language.

In Indian ,there are two language is official language, Hindi and English. Hindi is most popular and

base on North India language.  Beside these two main languages there still have many other Indian language.



Hindi Shree font:


Modular Systems from Pune, India, offers about 20 free truetype fonts for most Indic languages. The

fonts are all called Shree
something and appear complete. Covered are Assamese, Bengali, Hindi


(Devanagri), Gujarati, Kannada, Malayalam, Oriya, Punjabi, Tamil and
Telugu. In 1992, they made the

Malayalam fonts Shree-Mal-0501W, Shree-Mal-0502.



Here are some fonts download page.



Tamil: [ 'tæmil ] 
<script language="javascript">insertaudio( 'dgzzof','#e7f7f7');</script> 

n. 坦米尔人,坦米尔语

shree_tam_otf_0802.ttf

http://www.dinamalar.com/font.htm




Devanagari: [ ˌdeivə'nɑ:gəri ] 
<script language="javascript">insertaudio( 'nugzly','#e7f7f7');</script> 

n. 梵文字母, 天城体

Shree-Dev-0714

http://www.mmyvv.com/mmyvv-h/shree-dev.htm




Gujarati: 
<script language="javascript">insertaudio( 'qr4zjI','#e7f7f7');</script> 

古吉拉特语

http://www.sambhaav.com/

(http://mlcr.nagaokaut.ac.jp/main1/languages/gujarati.htm)




Kannada: [ 'kɑ:nədə ] 
<script language="javascript">insertaudio( '2przpz','#e7f7f7');</script> 

n. <印> 埃纳德语

Shree-Kan-0850

http://68.178.224.54/udayavani/help.asp?nosession=y&lang=2



Telugu: [ 'teləˌgu: ] 
<script language="javascript">insertaudio( '6gQzek','#e7f7f7');</script> 

泰卢固语(印度东部德拉维拉语言)

I only find shree_tel_0906

http://www.kamakoti.org/main/fonts.html



Reference:

http://en.wikipedia.org/wiki/Hindi


http://cg.scs.carleton.ca/~luc/telugu.html


http://ldc.upenn.edu/myl/hindi_fonts_and_conversions.html


http://ks.cn.yahoo.com/question/1406082812946.html
(Chinese)

Tuesday Nov 13, 2007

FW: Disks, partitions and slices under Solaris

These paper describe concept of disks, partitions and slices under Solaris. I think this a comprehensive description of these concept. Hope it can help you understand disk partitions and slice in Solaris. here only list the skelton. From http://multiboot.solaris-x86.org/iv/3.html  see details.

Disks, partitions and slices under Solaris

  • Disk addressing conventions

  • Slices and VTOC

  • Creating and mounting additional UFS file systems

  • Two Solaris partitions on the same drive

  • Mounting FAT partitions




http://multiboot.solaris-x86.org/iv/3.html  see details.

 

Monday Oct 29, 2007

FoxLingo - Foxfire extension - The Ultimate Language Tool (推荐一个firefox的终极语言工具扩展)

I have tried a Foxfire extension - FoxLingo . It's very cool language tool, so that it can be called The Ultimate Language Tool! It can :

  • Web Page Translation - Translates full web pages (over 1,000 different language pairs)
  • Translated Search - Searches foreign pages using terms written in your language
  • Auto Translation - Automatically translates websites by recognizing their domain
  • Text Translation - Translates text entered in the search box or selected on any web page
  • Language Resources - Over 90 language services
  • Ixquick - Metasearch with unique features, language search and complete privacy
  • Learning Languages - Over 100 links to language learning sites
  • Freeware - FoxLingo is completely free and contains no adware or spyware
  • Complete Privacy - FoxLingo does not take any information from it's users

Supports 45 languages:
Afrikaans, Arabic, Aranese, Basque, Bulgarian, Catalan, Chinese Simplified, Chinese Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Filipino, Finnish, French, Galician, German, Greek, Hebrew, Hungarian, Icelandic, Indonesian, Italian, Japanese, Korean, Latin, Malay, Norwegian, Persian, Polish, Portuguese, Portuguese Brazilian, Romanian, Russian, Serbian, Slovenian, Spanish, Spanish Latin American, Swedish, Thai, Turkish, Ukrainian, Welsh

Uses 34 free online web page translator services
Worldlingo.com, Tranexp.com, Google.com, Abacho.co.uk, Altavista.com, Bestiland.thread.ne.jp, Eigo-navi.com, Elmundo.es, Excite.co.jp, Freetranslation.com, Gencat.cat, Gts-translation.com, Ibm.com, Imtranslator.com, Internostrum.com, Interpret.co.za, Linguamatix.com, Lingvo.org, Nazgol.co.il, Nifty.amikai.com Ocn.ne.jp, Oesi.cervantes.es, Online-Translator.com, Opentrad.org, Sli.uvigo.es, Solvingmaze.com, Toggletext.com, Tr.voila.fr, Translatica.pwn.pl, Translendium.es, Vil-net.dyndns.org Yahoo.com, Xixona.dlsi.ua.es, 220.194.61.120

Download page here

推荐一个firefox扩展FoxLingo :终极语言工具!

目前支持45个语言。34个免费在线翻译服务。大家可以尝试一下,很酷。但是不爽的一点是,在简体中文的locale下,目前这个扩展的自身的菜单和按钮上的中文似乎没有简体的,只有繁体中文。希望能早日有简体中文的菜单。

这里下载
 

Sunday Jul 08, 2007

Shell Tips - how to compose variable ?

If you want to use compose variable name, such as

#/bin/sh
i=1
x1=stringX1

echo "$x$i"

The result "1" is not what you want.  It just string "$x"+"xi".

In sh using eval  can help you handle compose variable name:

#/bin/sh
i=1
x1=stringX1

eval echo "\\$x$i"

The result is "stringX1", it echo variable $x1' value. 

For more information about eval ,please see man page.

 

Here has some example of eval:

1.Set variable value by variable name condition

v1=aaa
v2=bbb
c=1
if [ $c -eq 1 ]
then
vname=v$c #find variable name by condition.
eval vvv="$"$vname ; echo vvv: $vvv #set v1 value to vvv, vvv=aaa
eval vvv='$'$vname ; echo vvv: $vvv #
set v1 value to vvv, vvv=aaa
#eval vvv=$$vname ; echo vvv: $vvv  #error usage
fi

2. v1' value "aaa" as a variable name, and set value for variable "aaa"

v1=aaa ; vaaa="This is aaa"
#eval $v1=$vaaa ; echo aaa: $aaa #error
#eval $v1="$vaaa" ; echo aaa: $aaa #error
eval $v1='$vaaa' ; echo aaa: $aaa


 

3.v1' value "aaa" as a variable name, and set variable name as value

v1=aaa ; vaaa="This is aaa"
eval $v1=$v1 ; echo aaa: $aaa
eval $v1="$v1" ; echo aaa: $aaa
#There is space in vaaa'value
eval $v1='$v1' ; echo aaa: $aaa

 

In Ksh who know how to use eval?  


 

Friday Jul 06, 2007

Shell Tips - shell如何执行“简单”命令?

转。

非常基础也很好的一个知识:

shell如何执行“简单”命令?

A: 这里的简单命令和bash参考手册里的含义相同,形式上一般是:命令的名称加上它的参数。有三种不同的简单命令:
1.内置命令(builtin)
是shell解释程序内建的,有shell直接执行,不需要派生新的进程。有一些内部命令可以用来改变当前的shell环境,如:
cd /path
var=value
read var
export var
...

2.外部命令("external command" or "disk command")
二进制可执行文件,需要由磁盘装入内存执行。会派生新的进程,shell解释程序会调用fork自身的一个拷贝,然后用exec系列函数来执行外部命令,然后外部命令就取代了先前fork的子shell。

3.shell脚本(script)
shell解释程序会fork+exec执行这个脚本命令,在exec调用中内核会检查脚本的第一行(如:#!/bin/sh),找到用来执行脚本的解释 程序,然后装入这个解释程序,由它解释执行脚本程序。解释程序可能有很多种,各种shell(Bourne shell,Korn shell cshell,rc及其变体ash,dash,bash,zshell,pdksh,tcsh,es...),awk,tcl/tk,expect, perl,python,等等。在此解释程序显然是当前shell的子进程。如果这个解释程序与当前使用的shell是同一种shell,比如都是 bash,那么它就是当前shell的子shell,脚本中的命令都是在子shell环境中执行的,不会影响当前shell的环境。

Shell Tips - (sed/awk equivalent Unix command ) 转:sed/awk与unix命令等价代码

转自: www.chinaunix.net 特此感谢

sed与unix 命令等价代码:

-------------------------------------------------------------------------------
cat            |  sed ':'
cat -s         |  sed '/./,/\^$/!d'
tac            |  sed '1!G;h;$!d'
grep           |  sed '/patt/!d'
grep -v        |  sed '/patt/d'
head           |  sed '10q'
head -1        |  sed 'q'
tail           |  sed -e ':a' -e '$q;N;11,$D;ba'
tail -1        |  sed '$!d'
tail -f        |  sed -u '/./!d'
cut -c 10      |  sed 's/\\(.\\)\\{10\\}.\*/\\1/'
cut -d: -f4    |  sed 's/\\(\\([\^:]\*\\):\\)\\{4\\}.\*/\\2/'
tr A-Z a-z     |  sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'
tr a-z A-Z     |  sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'
tr -s ' '      |  sed 's/ \\+/ /g'
tr -d '\\012'   |  sed 'H;$!d;g;s/\\n//g'
wc -l          |  sed -n '$='
uniq           |  sed 'N;/\^\\(.\*\\)\\n\\1$/!P;D'
rev            |  sed '/\\n/!G;s/\\(.\\)\\(.\*\\n\\)/&\\2\\1/;//D;s/.//'
basename       |  sed 's,.\*/,,'
dirname        |  sed 's,[\^/]\*$,,'
xargs          |  sed -e ':a' -e '$!N;s/\\n/ /;ta'
paste -sd:     |  sed -e ':a' -e '$!N;s/\\n/:/;ta'
cat -n         |  sed '=' | sed '$!N;s/\\n/ /'
grep -n        |  sed -n '/patt/{=;p;}' | sed '$!N;s/\\n/:/'
cp orig new    |  sed 'w new' orig[/code:1:739eb4cef5]
-------------------------------------------------------------------------------

awk与unix 命令等价代码:

-------------------------------------------------------------------------------
cat            |awk '{print}'
cat -s         |awk '{blank = NF == 0 ? ++blank : 0; if (blank <= 1) print;}'
tac            |awk '{t[NR] = $0;}END{for (i = NR; i >= 1; i--) print t[i];}'
grep patten    |awk '/patten/{print}'
grep -v patten |awk '! /patten/{print}'
head           |awk 'NR <= 10 {print}' 24.sh
head -1        |awk '{print; exit; }' 24.sh
tail           |awk '{t[n++ % 10] = $0}END{for (i = 0; i < 10; i++) print t[n++ % 10];}'
tail -1        |awk '{t = $0}END{print t}'
cut -c 10      |awk '{print substr($0, 10, 1)}'
cut -d: -f4    |awk -F: '{if (NF > 1) print $4; else print;}'
tr A-Z a-z     |awk '{print tolower($0);}' se.sh
tr a-z A-Z     |awk '{print toupper($0);}' se.sh
tr -s ' '      |awk '{print gensub(" +", " ", "g")}'
tr -d '\\012'   |awk '{printf "%s", $0}'
wc -l          |awk 'END{printf "% 7d\\n", NR-1}'
uniq           |awk '{if (NR == 1 || ln != $0) print; ln = $0;}'
rev            |awk '{l = ""; for (i = length($0); i > 0; i--) printf "%c", substr($0, i, 1); print "";}'
basename       |awk -F'/' '{print $NF}'
dirname        |awk -F'/' '{if (NF <= 1) printf "."; else {OFS="/"; $NF=""; printf "%s", substr($0, 1, length($0) - 1);}}'
xargs          |awk '{printf "%s ", $0}END{print}'
paste -sd:     |awk 'NR > 1{printf ":%s", $0}'
cat -n         |awk '{printf "% 6d  %s\\n", NR, $0}'
grep -n        |awk '/ss/{print NR":"$0}'
cp orig new    |awk '{print > "new"}' orig
-------------------------------------------------------------------------------


 

About

williamxue

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today