As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center提供指导。
9年前关闭。
嘿,我使用Linux已经有一段时间了,以为是时候开始深入研究Shell脚本了。
问题是我没有发现使用Bash优于Perl或Python的任何显着优势。两者之间是否存在性能或功率差异?我认为就功能和效率而言,Python/Perl更适合。 简单性:可直接访问所有出色的linux工具
为什么要不断使用python的
我越来越喜欢使用gnu parallel,通过它可以并行执行bash脚本。例如。从手册页中,批量并行创建目录中所有jpg的缩略图:
顺便说一下,我通常在bash脚本中有一些python调用(例如用于绘图)。使用最适合该任务的东西!
9年前关闭。
嘿,我使用Linux已经有一段时间了,以为是时候开始深入研究Shell脚本了。
问题是我没有发现使用Bash优于Perl或Python的任何显着优势。两者之间是否存在性能或功率差异?我认为就功能和效率而言,Python/Perl更适合。
最佳答案
我想到了两个优点:
wc
,ls
,cat
,grep
,sed
等。为什么要不断使用python的
subprocess
模块?ls *.jpg | parallel convert -geometry 120 {} thumb_{}
顺便说一下,我通常在bash脚本中有一些python调用(例如用于绘图)。使用最适合该任务的东西!