碰到个可能有意思的$. 小问题,求教
时间:2011-05-20
来源:互联网
前两周看到某帖子提到了$. ,当时学习了.刚才要用,结果诡异....
求教:请问1去哪里了?
复制代码
复制代码
求教:请问1去哪里了?
- cat 123
- 1
- 2
- 3
- 4
- cat 123|perl -ne 'while(<>){print "$.\t$_";}'
- 2 2
- 3 3
- 4 4
作者: chenhao392 发布时间: 2011-05-20
-n 什么意思清楚不?
作者: zhlong8 发布时间: 2011-05-20
回复 zhlong8
只是看人这么用了,就一直在用,查了下,说:
-n
Wrap the entire program (or one liner) in a loop that reads input using <> and assigns each input line to $_
只是看人这么用了,就一直在用,查了下,说:
-n
Wrap the entire program (or one liner) in a loop that reads input using <> and assigns each input line to $_
作者: chenhao392 发布时间: 2011-05-20
回复 zhlong8
太阳要落山了,得去吃饭了....回来再看帖子...
太阳要落山了,得去吃饭了....回来再看帖子...
作者: chenhao392 发布时间: 2011-05-20
QUOTE:
回复 zhlong8
只是看人这么用了,就一直在用,查了下,说:
-n
Wrap the entire program (or ...
chenhao392 发表于 2011-05-20 09:45
只是看人这么用了,就一直在用,查了下,说:
-n
Wrap the entire program (or ...
chenhao392 发表于 2011-05-20 09:45
cat 123 | perl -ne '{print "$.\t$_"}'
作者: jason680 发布时间: 2011-05-20
QUOTE:
回复 zhlong8
只是看人这么用了,就一直在用,查了下,说:
-n
Wrap the entire program (or ...
chenhao392 发表于 2011-05-20 09:45
只是看人这么用了,就一直在用,查了下,说:
-n
Wrap the entire program (or ...
chenhao392 发表于 2011-05-20 09:45
如果LZ查看了-n是什么意思仍然不解,那就google一下“一行Perl”
作者: py 发布时间: 2011-05-20
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28