Chinaunix首页 | 论坛 | 博客
  • 博客访问: 927819
  • 博文数量: 146
  • 博客积分: 3321
  • 博客等级: 中校
  • 技术积分: 1523
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-29 10:32
文章分类

全部博文(146)

文章存档

2014年(2)

2013年(5)

2012年(4)

2011年(6)

2010年(30)

2009年(75)

2008年(24)

分类: LINUX

2009-08-21 09:33:49

ls命令显示的格式是一个文件占一行。虽然我们看到的结果是显示结果他是好几个文件并列在同一行。
根据下面这个也可以看到:

along@along-laptop:~/code/shell$ ls
awk cut grep sed shell sort system_status test tr
along@along-laptop:~/code/shell$ ls > file
along@along-laptop:~/code/shell$ cat file
awk
cut
file
grep
sed
shell
sort
system_status
test
tr

along@along-laptop:~/code/shell$ awk 'BEGIN{"ls"|getline d;print d}'
awk

getline是每次从当前输入读入一行。
阅读(2716) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~