Linux terminal (or Shell language generally) can do many beautiful things such as tricks, whether in terms of benefit of programming, or in terms of tricks and entertainment, and in this lesson we will learn about small code that executes an infinite loop which make the drive (CD / DVD Drive) closes and opens itself repeatedly, and of course will not stop unless you stop your own script, and you will learn about it.
1. First, Create a new text file under any name you want (for example, I I would call it script), at the end of your file name, add .sh
now the name will be like this : script.sh
2. Now, copy the following codes, and paste then in the text file script.sh :
#! / Bin / sh
while [1 = 1]
#pull CDROM tray back in
3. Save the file and close it.
4. Go to the File Properties and Permissions tab, check the option appeared in the picture :
5. Now run the file, and if this message appears, press Run in Terminal, and now you will see how the drive will still opens and closes on its own, until you stop it.
How do I stop it ? Simply close the terminal window.