Вопрос

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
Это было полезно?

Решение

This will wait until a user named "Milad" is logged in.

who gets the list of logged in users, grep "Milad" filters the list returned by who for entries that contain Milad. 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 user Milad, sleeping 60 seconds between each test.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top