Debian's which hunt
Debian's which hunt
Posted Oct 28, 2021 16:12 UTC (Thu) by jhoblitt (subscriber, #77733)Parent article: Debian's which hunt
While I confess to frequently using `which` on the interactive command line, this utility has been causing me grief in build systems for decades. The only sane thing to do when relying on a shell is to replace it with `command -v`. The behavior of `which` is *non-standard*. It is not present by default in many operating systems, including many flavors of linux. The behavior of the command, if it exists, can be strangely different. This isn't theoretical, it has caused real world portability I've experienced. Sadly, the Huffman encoding and memorability of `command -v` is terrible but it has been part of posix essentially "forever".
