79271970

Date: 2024-12-11 13:58:17
Score: 1
Natty:
Report link

To make this work in zsh or bash, such that aliases & functions are not considered while still being POSIX-compliant, just shell out:

xdg_open_path="$(sh -c "command -v xdg-open")"
if [ "$?" -eq 0 ]; then
    echo "xdg-open: is ${xdg_open_path}"
else
    echo 'xdg-open: not found' 1>&2
fi
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Ernest Izdebski