免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 1764 | 回复: 13
打印 上一主题 下一主题

这样咋整 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-07-13 09:46 |只看该作者 |倒序浏览
[aluns]~>cat t.txt
Entries in termcap consist of a number of `:'-separated fields. The first entry for each terminal gives the names that are known for the terminal, separated by `|' characters. The first name given is the most common abbreviation for the terminal. The last name given should be a long name fully identifying the terminal, and all others are understood as synonyms for the terminal name. All names but the last should be in lower case and contain no blanks; the last name may well contain upper
----------------让它变成
[aluns]~>cat t.txt
Entries in termcap consist of a number of `:'-separated fields. The first entry for each

terminal gives the names that are known for the terminal, separated by `|' characters.

The first name given is the most common abbreviation for the terminal. The last name

given should be a long name fully identifying the terminal, and all others are understood

as synonyms for the terminal name. All names but the last should be in lower case and

contain no blanks; the last name may well contain upper

----------------------

论坛徽章:
0
2 [报告]
发表于 2006-07-13 10:05 |只看该作者
建议用stty+sed

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
3 [报告]
发表于 2006-07-13 10:06 |只看该作者
fold -s -w 90 t.txt|sed 'G'

论坛徽章:
0
4 [报告]
发表于 2006-07-13 11:58 |只看该作者
那个文件、只有一行,

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
5 [报告]
发表于 2006-07-13 12:08 |只看该作者
一行又如何?你试过了吗?

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
6 [报告]
发表于 2006-07-13 12:18 |只看该作者
不会是连这个都不会吧:
old -s -w 90 t.txt|sed 'G' > folded
mv folded t.txt

论坛徽章:
0
7 [报告]
发表于 2006-07-13 12:20 |只看该作者
不是想用什么sed....,而是直接用cat就显示出这个效果,只是想在一行结束的时候,跳到隔一行位置输出。在tput里没找到,再找找。

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
8 [报告]
发表于 2006-07-13 15:27 |只看该作者
Sorry!我不知道楼主对sed过敏的。^_^
但非常遗憾,据我所知,cat没有你想要的功能。如果真的如此在意,可以写个简单脚本可以叫做CAT,或jcat之类:
#!/bin/sh
fold -sw90 $* |\
sed G
#end
然后只要打CAT t.txt就行了。

另外,如果你的终端屏幕是正常的大小,请修改上面的90为80。^_^

论坛徽章:
0
9 [报告]
发表于 2006-07-13 20:19 |只看该作者
你咋没明白、我说的意思呢?


这个和t.txt没有关系,我不要一个文本,而是想让所有的输出的东西,都变成那样、包括一个命令

哎~~~、

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
10 [报告]
发表于 2006-07-14 00:31 |只看该作者
是把默认的换行符由一个变两个吧?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP