From: Karel Zak Date: Thu, 16 Apr 2026 12:25:03 +0000 (+0200) Subject: flock: document shell selection in man page X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=ed50e9abb6c829edf7801c0728bdab1fb600be06;p=thirdparty%2Futil-linux.git flock: document shell selection in man page Add ENVIRONMENT section with SHELL entry, documenting that flock uses $SHELL with fallback to /bin/sh for non-interactive -c command execution. The user's passwd(5) shell is not consulted. Addresses: https://github.com/util-linux/util-linux/issues/4242 Signed-off-by: Karel Zak --- diff --git a/sys-utils/flock.1.adoc b/sys-utils/flock.1.adoc index e250059b4..a03936d70 100644 --- a/sys-utils/flock.1.adoc +++ b/sys-utils/flock.1.adoc @@ -56,7 +56,7 @@ The third form uses an open file by its file descriptor _number_. See the exampl == OPTIONS *-c*, *--command* _command_:: -Pass a single _command_, without arguments, to the shell with *-c*. +Pass a single _command_, without arguments, to the shell with *-c*. See *SHELL* in the *ENVIRONMENT* section. *-E*, *--conflict-exit-code* _number_:: The exit status used when the *-n* option is in use, and the conflicting lock exists, or the *-w* option is in use, and the timeout is reached. The default value is *1*. The _number_ has to be in the range of 0 to 255. @@ -104,6 +104,11 @@ The command uses exit status values for everything, except when usi When using the _command_ variant, and executing the child worked, then the exit status is that of the child command. +== ENVIRONMENT + +*SHELL*:: +The shell used for *-c* _command_ execution. If *SHELL* is not set, _/bin/sh_ is used as the fallback. The user's passwd(5) shell is not consulted, as the command is executed non-interactively. + == NOTES *flock* does not detect deadlock. See *flock*(2) for details.