I forget to add ‘&& …’ when executing the command first time.
1 |
$ while ps c | grep -w 'command name' ; do echo 'Not yet' ; sleep 10 ; done && eject |
1 |
$ while ps axw | grep -v 'grep' | grep 'find word' ; do echo 'Not yet' ; sleep 10 ; done && eject |
close tray:
1 |
$ eject -t |