]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
flock: document shell selection in man page
authorKarel Zak <kzak@redhat.com>
Thu, 16 Apr 2026 12:25:03 +0000 (14:25 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 16 Apr 2026 12:29:28 +0000 (14:29 +0200)
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 <kzak@redhat.com>
sys-utils/flock.1.adoc

index e250059b4fd69b95adbb6e3c1d00e90828a44f5b..a03936d7005b4672b614ca1eb298d62bbd35d4ea 100644 (file)
@@ -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 <sysexits.h> 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.