惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
aimingoo的专栏
aimingoo的专栏
MongoDB | Blog
MongoDB | Blog
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
Y
Y Combinator Blog
T
Tailwind CSS Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
SegmentFault 最新的问题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
J
Java Code Geeks
美团技术团队
Google DeepMind News
Google DeepMind News
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
T
The Blog of Author Tim Ferriss

LWN.net comments

Intel bug workaround Browser A hurdle for the attacker? [LWN.net] Browser [LWN.net] schism status [LWN.net] PQC signing for distros relying on OpenPGP? [LWN.net] Browser [LWN.net] Browser [LWN.net] Browser [LWN.net] Better off keeping it vague [LWN.net] Browser [LWN.net] Complete opposite [LWN.net] A hurdle for the attacker? [LWN.net] Better off keeping it vague [LWN.net] Better off keeping it vague [LWN.net] Under 10 [LWN.net] With hindsight, it was a code smell anyway [LWN.net] With hindsight, it was a code smell anyway [LWN.net] A hurdle for the attacker? [LWN.net] A hurdle for the attacker? [LWN.net] A careful programmer... [LWN.net] PQC signing for distros relying on OpenPGP? [LWN.net] PQC signing for distros relying on OpenPGP? [LWN.net] PQC signing for distros relying on OpenPGP? [LWN.net] PQC signing for distros relying on OpenPGP? [LWN.net] Better off keeping it vague [LWN.net] It's a shame [LWN.net] Is your age restriction really necessary? [LWN.net] PQC signing for distros relying on OpenPGP? [LWN.net] Our editor-in-chief's inimitable dry humor [LWN.net] PQC signing for distros relying on OpenPGP? [LWN.net] schism status [LWN.net] Does using per-CPU variables in preemptable code make sense? [LWN.net] One option for dirty frag via selinux, dependent on user cases where ipsec is needed [LWN.net] Better off keeping it vague [LWN.net] Cost of LLMs in the cloud [LWN.net] Cost of LLMs in the cloud [LWN.net] everyone wins here [LWN.net] Thoughts from a younger generation.. [LWN.net] a bit of fishes vs bicycles comparison [LWN.net] Better off keeping it vague [LWN.net] Better off keeping it vague [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Better off keeping it vague [LWN.net] Better off keeping it vague [LWN.net] Better off keeping it vague [LWN.net] Some performance numbers? [LWN.net] workaround is okay [LWN.net] Better off keeping it vague [LWN.net] Thoughts from a younger generation.. [LWN.net] OpenWrt One still available for sale! [LWN.net] Does using per-CPU variables in preemptable code make sense? [LWN.net] Excellent communication [LWN.net] It's a shame [LWN.net] Fade out [LWN.net] Fade out [LWN.net] Which cards? [LWN.net] Which cards? [LWN.net] Better off keeping it vague [LWN.net] Hype isn't going anywhere at this rate [LWN.net] Per-CPU PGDs... [LWN.net] It's a shame [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] __set_flex_counter() and __flex_counter() [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] If you only want to work, why live? [LWN.net] Thoughts from a younger generation.. [LWN.net] If you only want to work, why live? [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] RISKS Archive [LWN.net] RISKS Archive [LWN.net] Origin of the quote. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] RISKS Archive [LWN.net] "Reproducible" sounds like a yes/no question but it's not [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net] Thoughts from a younger generation.. [LWN.net]
With hindsight, it was a code smell anyway [LWN.net]
NYKevin · 2026-05-23 · via LWN.net comments

I would go further. There is way too much use of the shell to do things that you could just as easily do by hand. In my book, there are only two legitimate reasons to invoke the shell:

* You are implementing a launcher or the like, and passing a user-input command line directly to the shell with little or no modification.
* You are executing a shell script (possibly one that you wrote), and that shell script has gone through the usual linters (shellcheck and whatnot).

The following cases are not legitimate:

* system(3) is more convenient than fork(2)/execlp(3) (get over it and write the extra 5-10 lines of code).
* You have some convoluted command line and don't want to do it all by hand (write a very short shell script instead).
* Nobody told you that execlp(3) exists, and you're just following what the LLM says (I'm willing to forgive this, but not excuse it - please educate yourself before you write code that will be used by other people).