Bash 4.0 和 Readline 6.0 发布

Bash 4.0 已经发布。除了修正 Bash 3 分支中的重要缺陷之外,该版本也添加了一些值得提及的新特性。这主要包括:

  • 关联数组
  • 改进了可编程完成函数
  • case-modifying 单词扩充
  • 复合进程
  • 支持 `**' 特别 glob 模式
  • 增加了 shell 语法及重定向

与此同时,Readline 库也发布了新的 6.0 版本,其中引入了一些新的变量,包括 rlsortcompletionmatches、rlcompletioninvokingkey、history-size(用户可设置)、revert-all-at-newline 等;同时增加了几个函数,实现了新的菜单完成代码。

Bash 4.0 及 Readline 6.0 的详细更改内容,你可以参阅其发布公告

Bash & Readline

[via LWN & Solidot]

Read More:

24 Comments

  1. 1 oceanboo Commented @ 2009-02-24 16:45Reply to this comment

    这两个包暂时还是不要动的好,当这两个包的小白鼠是不明智的。

  2. 2 Terry Wang Commented @ 2009-02-24 16:45Reply to this comment

    去官方网站下binary,只有200b/s,昏过去。

    还是等发行版的repository更新得了,相信这个会出现在官方的更新里的。-_-

    sofa?

  3. 3 Mike Commented @ 2009-02-24 17:47Reply to this comment

    zsh rocks!

  4. 4 superjet Commented @ 2009-02-24 18:07Reply to this comment

    大家都不去当白鼠就都没得玩了,好在白鼠发行版很快就会跟进的,没了fc、opensuse等在前面趟路何来服务器版的稳定,感谢之

  5. 5 Chung Commented @ 2009-02-24 18:39Reply to this comment

    arch 已经在讨论这两个东东..也在为x-server1.6做准备了

  6. 6 oldherl Commented @ 2009-02-24 19:42Reply to this comment

    又有东西来折腾我这只arch白鼠了

  7. 7 bashup Commented @ 2009-02-25 9:17Reply to this comment

    两个包都升级了,现在用着,都正常.

  8. 8 Dongsheng Commented @ 2009-02-25 14:06Reply to this comment

    昨天装了 4,但自动完成路径的时候会 crash(完成程序名没问题),有朋友遇到这个问题吗?

  9. 9 danath Commented @ 2009-02-25 15:09Reply to this comment

    能否问一下,大家不用Perl/Python而用shell脚本的理由是什么?(诚心发问,无褒贬之意图)

  10. 10 华华 Commented @ 2009-02-25 20:48Reply to this comment

    @danath: 使用 Python 又不跟 bash 冲突。

  11. 11 danath Commented @ 2009-02-25 23:22Reply to this comment

    既然可以使用安全高效兼容性好的Perl/Python,为什么还要用bash编写脚本,结果换个shell就可能玩不转?进一步,为什么还要开发shell的编程功能?

  12. 12 yymailb Commented @ 2009-02-26 2:12Reply to this comment

    我也只写过python脚本, 同问下danath的问题, shell编程有何特别的优点么?

  13. 13 fdas Commented @ 2009-02-27 11:37Reply to this comment

    系统上总有SHELL。却不一定有PYTHON。这种白痴问题。

  14. 14 danath Commented @ 2009-02-27 12:56Reply to this comment

    你知道系统上的shell一定是你会的?还是你洞悉所有shell?这种白痴理解力。

  15. 15 sylecn Commented @ 2009-02-27 12:59Reply to this comment

    @danath: shell里面可以很方便使用管道和众多GNU的命令行处理程序。Python就没有那么方便了。 因为Shell编程一般都是把几个程序揉在一起实现一个新的功能。

    如果你要实现一个复杂的逻辑,而不是简单的使用已有的命令组合,那Python是很好的选择。当然C也可以。

    @fdas: 现在大部分*nix系统上都有Python。

  16. 16 fdas Commented @ 2009-02-27 15:03Reply to this comment

    呵呵。Bourne shell,哪个上面没有? Python你换个版本试下? /etc/init.d下那些脚本,到底用什么更方便?

  17. 17 daqing Commented @ 2009-02-27 15:20Reply to this comment

    @danath: 比如我要批量修改某个类型文件中的特定字符串, 用shell写比用Python方便多了.

  18. 18 daqing Commented @ 2009-02-27 15:26Reply to this comment

    @yymailb: shell + sed + awk + grep 非常强大.

  19. 19 danath Commented @ 2009-02-27 18:21Reply to this comment

    @fdas

    公司的服务器上缺省tcsh,有bash但缺少tcsh的设置,用着不方便(只能自己动手把设置再写一遍,而且没有IT的支持)。

  20. 20 danath Commented @ 2009-02-27 18:27Reply to this comment

    @sylecn

    你是说简单脚本用shell,复杂脚本用Perl/Python?

  21. 21 danath Commented @ 2009-02-27 18:29Reply to this comment

    @daqing

    好像只用Perl也有同样效果,移植性还好些,还只用学一种语言。

  22. 22 b4283 Commented @ 2009-03-12 13:04Reply to this comment

    bash 腳本調用檔案程序更容易一些 而且可以作成複雜的 GNU tools 的 pipe 組合 python 也可以但不容易

    相較之下,python 可以使用較複雜的邏輯 (bash 甚至不能作小數運算) 也可以調用 python library

    兩者各有功能,不過在下較喜好 bash... 因為很簡單的指令就可以作到很強大的功能,而且 shell 之下本來就不需要太複雜的判斷,反倒是對檔案的操作比較常使用。

  23. 23 cofairy Commented @ 2009-03-26 13:35Reply to this comment

    @Dongsheng: 那是因为用了bash-completion的原因。 bash 4.0 与之配合用,就会crash

  24. 24 Dongsheng Commented @ 2009-03-26 15:25Reply to this comment

    @cofairy: 谢谢,终于明白怎么回事了