Php web hosting - echo press interrupt (CTRL-C) to interrupt …. while

echo press interrupt (CTRL-C) to interrupt …. while [ -f /tmp/my_tmp_file_$$ ]; doecho File existssleep 1doneecho The file no longer existstrap INTecho creating file /tmp/my_tmp_file_$$ date > /tmp/my_tmp_file_$$ echo press interrupt (control-C) to interrupt …. while [ -f /tmp/my_tmp_file_$$ ]; doecho File existssleep 1doneecho we never get hereexit 0If we run this script, pressing Ctrl+C (or whatever your interrupt keys are) in each of the loops, we following output: creating file /tmp/my_tmp_file_141press interrupt (CTRL-C) to interrupt …. File existsFile existsFile existsFile existsThe file no longer existscreating file /tmp/my_tmp_file_141press interrupt (CTRL-C) to interrupt …. File existsFile existsFile existsFile existsHow It WorksThis script uses the trapcommand to arrange for the command rm -f /tmp/my_tmp_file_$$to when an INT(interrupt) signal occurs. The script then enters a whileloop that continues file exists. When the user presses Ctrl+C, the statement rm -f /tmp/my_tmp_file_$$is executed, and then the whileloop resumes. Since the file has now been deleted, the first whileloop terminatesnormally. The script then uses the trapcommand again, this time to specify that no command be executed whenan INTsignal occurs. It then recreates the file and loops inside the second whilestatement. When presses Ctrl+C this time, there is no statement configured to execute, so the default behavior occurs, which is to immediately terminate the script. Since the script terminates immediately, the final echoandexitstatements are never executed.
Note: If you are looking for high quality webhost to host and run your jsp application check Vision jsp web hosting services

WordPress database error: [Table 'armadillowebhosting_com_-_apache.wp_comments' doesn't exist]
SELECT * FROM wp_comments WHERE comment_post_ID = '87' AND comment_approved = '1' ORDER BY comment_date

Leave a Reply