Answer the question
In order to leave comments, you need to log in
How to process the result of a command through grep?
Good day
Tell me how to process the result of the command
#/bin/bash
error = $(sudoedit -s / | grep ...не знаю как написать что бы результат вывел ;/ )
error2 = ;/
if error == error2
then
........
Answer the question
In order to leave comments, you need to log in
sudo -V | head -n 1 |awk '{ print $3 }'
conclusion
1.8.21p2
if [ "$(sudo -V | head -n 1 |awk '{ print $3 }')" = "1.8.21p2" ]; then
echo "все сработало"
fi
if ; then
echo "все сработало 1.8.21p2"
elif ; then
echo "все сработало 1.0"
fi
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question