Could somebody explain what this bit of code means please ?
I believe the second line is “if the exit status is zero”, then echo “valid command” but I dont understand the first line
$@ &>/dev/null
if [[ $? = 0 ]]
then
echo "Valid command"
fi
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’d like to add that this is unnecessarily verbose and could be shortened to
or even shorter