LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: zBS

[求助]文件内容分割问题...

[复制链接]
发表于 2005-5-9 19:32:49 | 显示全部楼层
呵呵,原来兄弟这里误解了,
[^>] 这在正则表达式中意思就是匹配非>!而不是开头第一个!因为它在[]内部!^相当于非的意思
回复 支持 反对

使用道具 举报

发表于 2005-5-10 13:52:43 | 显示全部楼层
Post by zhy2111314
呵呵,原来兄弟这里误解了,
[^>] 这在正则表达式中意思就是匹配非>!而不是开头第一个!因为它在[]内部!^相当于非的意思


刚又去翻了下正则   ,, 受教了    ,,   :%
回复 支持 反对

使用道具 举报

发表于 2005-5-12 02:40:28 | 显示全部楼层
Post by zBS
cu那边有人帮忙解决了... 贴出来大家共勉一下..
  1. /home/lee#cat a
  2. <text id="fld-sharing">Folder sharing</text>
  3. <text id="fld-sharing-add-user">Add user</text>
  4. <text id="fld-sharing-add-group">Add group</text>
  5. <text id="fld-sharing-add-all">Add all users</text>
  6. <text id="fld-sharing-all-users">All authenticated users</text>
  7. <text id="fld-sharing-user">User</text>
  8. <text id="fld-sharing-level">Permission level</text>
  9. <text id="fld-sharing-owner">Owner</text>
  10. <text id="fld-sharing-administrator">Administrator</text>
  11. <text id="fld-sharing-editor">Editor</text>
  12. <text id="fld-sharing-reader">Reader</text>
  13. <text id="fld-sharing-none">None</text>
  14. /home/lee#cat b
  15. 共享此文件夹
  16. 添加用户
  17. 添加组
  18. 添加所有用户
  19. 验证所有用户
  20. 用户
  21. 共享级别
  22. 所有者
  23. 管理员
  24. 编辑
  25. 读取
  26. 关闭共享
复制代码
  1. /home/lee#\
  2. > while read -u3 a && read -u4 b;do
  3. > echo $a|sed "s/>.*</>$b</" >>c.txt
  4. > done 3<a 4<b
  5. /home/lee#cat c.txt
  6. <text id="fld-sharing">共享此文件夹</text>
  7. <text id="fld-sharing-add-user">添加用户</text>
  8. <text id="fld-sharing-add-group">添加组</text>
  9. <text id="fld-sharing-add-all">添加所有用户</text>
  10. <text id="fld-sharing-all-users">验证所有用户</text>
  11. <text id="fld-sharing-user">用户</text>
  12. <text id="fld-sharing-level">共享级别</text>
  13. <text id="fld-sharing-owner">所有者</text>
  14. <text id="fld-sharing-administrator">管理员</text>
  15. <text id="fld-sharing-editor">编辑</text>
  16. <text id="fld-sharing-reader">读取</text>
  17. <text id="fld-sharing-none">关闭共享</text>

复制代码

谢谢大家帮忙.

怎么看着那么眼熟 ?
回复 支持 反对

使用道具 举报

发表于 2005-5-12 08:41:19 | 显示全部楼层
怎么看着那么眼熟 ?

你给的答案,当然眼熟
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表