I use this Bash oneliner,
set -o errexit;set -o pipefail;set -o nounset;doas() { [[ "${EUID}" == '0' ]]||set -- command doas "${@}";"${@}";}
in the head of my scripts in order to prevent me from being asked for a password when I'm root. From what I gathered , if any arguments follow --
, then the the positional parameters are set to the arguments. What does command
do in my oneliner? Is it a Bash bult-in (which command
returns nothing)? Would someone decode it and give another example of using command
. Where can I read more about command
?
Asked by John Smith
(827 rep)
Nov 2, 2023, 06:22 AM