I want to know what is this command do?
In addition, the ‘who | grep > /dev/null’ in this loop why must return true or false:
until who | grep “Milad” > /dev/null
do
sleep 60
done
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.
This will wait until a user named “Milad” is logged in.
whogets the list of logged in users,grep "Milad"filters the list returned bywhofor entries that containMilad. This will return “true” if the entry was found. To suppress any output, it is redirected to the digital toilet (> /dev/null). The whole thing then loops while there is no userMilad, sleeping 60 seconds between each test.