macos aix linux shell
I'm rewriting some existing code and noticed that a shell call to `env` (without arguments) is wrapped in error trapping code. Now I'm curious, under what circumstances could `env` conceivably fail?

The code is intended to run under AIX, macOS X, and all Linux distros, including Raspbian.
Top Answer
Jack Douglas
`env` isn't a builtin, so a shell call to `env` will fail if the executable does not exist for some reason.

::: tio S0oszvj/v6SyIFUhNa/s/38A
§§§ bash bash
type env
``` none
env is /usr/bin/env

I can imagine that some ancient (pre v5) version of AIX could be missing the `env` binary.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.