command/argument,name

This commit is contained in:
Marc Beninca 2024-12-02 04:02:26 +01:00
parent e60e72d1da
commit 68ec08871c
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -13,8 +13,15 @@ RWX_SELF_COMMAND="_${RWX_SELF_NAME}_cmd_"
# │ main │ variables │
# ╰──────┴───────────╯
RWX_COMMAND_ARGUMENT="${0}"
RWX_SHELL="$(cat "/proc/${$}/comm")"
RWX_COMMAND_NAME="$(basename "${RWX_COMMAND_ARGUMENT}" |
sed "s|^-||")"
case "${RWX_COMMAND_NAME}" in
"bash" | "dash" | "sh") unset RWX_COMMAND_NAME ;;
*) ;;
esac
RWX_ROOT_SYSTEM="/usr/local/lib/${RWX_SELF_NAME}"
RWX_SELF_USER="${HOME}/${RWX_SELF_NAME}"