Skip to content

Commit

Permalink
Update bits-info.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git authored Sep 27, 2024
1 parent 2479a8f commit 4c8d40b
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions tools/bits-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -335,19 +335,25 @@ main()
fi

echo '==='
readlink 2> /dev/null "/proc/${$}/exe"; printf '\n$?'
readlink 2> /dev/null "/proc/${$}/exe" || true; printf "\n"
if shell_exe="$(readlink 2> /dev/null "/proc/${$}/exe")"; then
echo "${shell_exe:?}" #
fi
echo '---'
tmp_var="$(ps 2> /dev/null -p "${$}" -o 'comm=')" && test -n "${tmp_var?}" && tmp_var2="$(command 2> /dev/null -v "${tmp_var:?}")"; echo $?
echo "$tmp_var"
echo "$tmp_var2"
readlink "$tmp_var2"
readlink -f "$tmp_var2"
realpath "$tmp_var2"
ps 2> /dev/null -p "${$}" -o 'comm='
if tmp_var="$(ps 2> /dev/null -p "${$}" -o 'comm=')" && test -n "${tmp_var?}" && tmp_var="$(command 2> /dev/null -v "${tmp_var:?}")"; then
# On Linux / macOS
shell_exe="$(readlink 2> /dev/null -f "${tmp_var:?}" || realpath 2> /dev/null "${tmp_var:?}" || "${tmp_var:?}")"
echo "${shell_exe:?}" #
fi
echo '---'
echo "${BASH:-${SHELL-}}"
command -v "${BASH:-${SHELL-}}"; echo $?
echo "${BASH:-${SHELL-}}"
if tmp_var="${BASH:-${SHELL-}}" && test -n "${tmp_var?}" && tmp_var="$(command 2> /dev/null -v "${tmp_var:?}")"; then
echo "${tmp_var:?}" #
shell_exe="$(readlink 2> /dev/null -f "${tmp_var:?}" || realpath 2> /dev/null "${tmp_var:?}" || "${tmp_var:?}")"
echo "${shell_exe:?}" #
fi
echo '==='


shell_info="$(get_shell_info || true)"
shell_name="$(printf '%s\n' "${shell_info:?}" | cut -d ' ' -f '1' || true)"
Expand Down

0 comments on commit 4c8d40b

Please sign in to comment.