由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - how to let awk not print?
相关主题
how to get rid of the ^M in files?how to run background process after logout
Print out Line Number using lp ???关于cxterm的问题
A question about command timeRe: how to change all the files .cpp to .C
perl Q[转载] About the history
Perl问题求助 (转载)如何单步执行shell?
50伪币:请教perl代码差错的问题!多谢啦!which shell is best?
perl 新手弱问equivilent $REMOTEHOST in ksh
what is the cpu usage means in top/gtop?shell programming问题:如何同时run多个作业
相关话题的讨论汇总
话题: awk话题: print话题: use话题: tcsh话题: csh
进入Unix版参与讨论
1 (共1页)
o*******e
发帖数: 31
1
The default action is print the line
when we use awk, but if I don't want
to print out the line, how can I do
that?
If I want to get rid of the empty line
in a file, can I just use awk or I need
to use sed?
h******a
发帖数: 198
2
awk '!/^$/' urfile
perl -pi -e 's/^$//g' urfile
sed -ne '/^$/!p' urfile
if using tcsh/csh, be careful of using !

【在 o*******e 的大作中提到】
: The default action is print the line
: when we use awk, but if I don't want
: to print out the line, how can I do
: that?
: If I want to get rid of the empty line
: in a file, can I just use awk or I need
: to use sed?

o*******e
发帖数: 31
3
what shell do u use?
so awk/perl/sed should be shell independent?
BTW, what is the meaning of '$!' in awk
u just mentioned?
What is the meaning of -pi -e for perl?

【在 h******a 的大作中提到】
: awk '!/^$/' urfile
: perl -pi -e 's/^$//g' urfile
: sed -ne '/^$/!p' urfile
: if using tcsh/csh, be careful of using !

h******a
发帖数: 198
4
csh/tcsh deemed harmful for programmers.
! has many special meanings in csh/tcsh.
if you try them in csh/tcsh, you will know

【在 o*******e 的大作中提到】
: what shell do u use?
: so awk/perl/sed should be shell independent?
: BTW, what is the meaning of '$!' in awk
: u just mentioned?
: What is the meaning of -pi -e for perl?

1 (共1页)
进入Unix版参与讨论
相关主题
shell programming问题:如何同时run多个作业Perl问题求助 (转载)
Change shell to tcsh?50伪币:请教perl代码差错的问题!多谢啦!
.cshrc?.login?.profile?perl 新手弱问
bash 彩色 shell promptwhat is the cpu usage means in top/gtop?
how to get rid of the ^M in files?how to run background process after logout
Print out Line Number using lp ???关于cxterm的问题
A question about command timeRe: how to change all the files .cpp to .C
perl Q[转载] About the history
相关话题的讨论汇总
话题: awk话题: print话题: use话题: tcsh话题: csh