rust-coreutils/coreutils-wrapper.sh
Michel Lind 32837b1c6f
Update to version 0.0.27; Fixes: RHBZ#2293806
Signed-off-by: Michel Lind <salimma@fedoraproject.org>
2024-08-02 16:23:48 -05:00

23 lines
595 B
Bash
Executable file

#!/bin/sh
# Wrapper to invoke coreutils multicall via individual libexec symlink
#
# To use:
# - symlink this to /usr/bin/uu_$utility
# - it will invoke /usr/libexec/uutils-coreutils/$utility
# - that is in turn a symlink to /usr/bin/uutils-coreutils, which is a
# multicall binary that behaves like $utility when that is argv[0]
CALLED_AS=$(basename "$0")
UTILITY=${CALLED_AS#uu_}
CMD="/usr/libexec/uutils-coreutils/$UTILITY"
if [ -L "$CMD" ]; then
# we want the argv to be passed as-is here
# shellcheck disable=SC2068
"$CMD" $@
else
echo "Error: $CMD not found" >&2
exit 1
fi