This is the script I wrote to make an automated POC baby-sitter in 5 lines.

I first found this on a GIF or meme site and thought of making a POC script that does the same.

Automated babysitting using Linux

#How Linux users babysit
while : 
do
    eject
    eject -t
done

I don't know aything about bash. So, I want improvements.

You can find the origin and the script at https://linuxandstuff.wordpress.com/2015/11/21/messing-with-the-dvd-drive-in-command-line/

  • Add some delay to that. – Ave Jun 19 '16 at 13:14
up vote 3 down vote accepted

These days a -T (toggle) argument exists. That allows us to make this a lot neater:

watch -n0 eject -T

You can alter the delay between rocks by changing the -n0 argument.

watch is used to run any designated command at regular intervals.

http://www.linfo.org/watch.html

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.