可以参看 Google code style ( https://google-styleguide.googlecode.com/svn/trunk/shell.xml )里一段: If you find you need to use arrays for anything more than assignment of ${PIPESTATUS}, you should use Python. - If you are writing a script that is more than 100 lines long, you should probably be writing it in Python instead. Bear in mind that scripts grow. Rewrite your script in another language early to avoid a time-consuming rewrite at a later date. - 如果有复杂的的对象,请使用 Python ;- 如果写了超过 100 行的 shell 脚本,考虑使用 Python 重写。
zho6
2015-12-26 23:12:51 +08:00
收藏了 562 行的 shell 费心的工作 感谢无私的分享 :-)
KentY
2015-12-26 23:13:34 +08:00
@crowds 恕我直言, 我觉得这太教条了. 你可以搜索一下你电脑里的 shellscript, 超过 100 行的有多少, 他们又有多少会转到 python. 而且这毕竟是 google 他们自己的 convention, 虽然 google 对软件开发行业推动很大, 但不能这么教条我觉得.