6 # convert the libtool internal path
10 local C2="$(echo "$C" | sed 's#^\(.*/\)\.libs/lt-\([^/]\+\)$#\1\2#')"
11 if [[ "$C2" != "$C" && ! -x "$C2" ]]; then
12 # such a file does not exist... back to $C
18 if [[ $UID == 0 ]]; then
19 # we are already root. Execute directly.
20 exec "$(resolve_cmd "$CMD")" "$@"
21 elif [[ "$NMTST_SUDO_NO_CALL_SELF" != "" ]]; then
22 # when setting $NMTST_SUDO_NO_CALL_SELF, pass the (resolved) command
24 exec sudo "$(resolve_cmd "$CMD")" "$@"
26 # by default, call self again with sudo.
27 exec sudo -E "$0" "$CMD" "$@"