Qu'est-ce que cette commande unix faire « qui | grep « Milad »> / dev / null '?
Question
Je veux savoir quel est ce do commande?
En outre, le « qui | grep> / dev / null » dans cette boucle pourquoi doit retourner true ou false:
until who | grep “Milad” > /dev/null
do
sleep 60
done
La solution
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.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow