Exec for Linux shell

Source: Internet
Author: User


Restart the service today and find that there is no restart item in the service bin directory. For more information, you can only restart a service by running the stop command and start command. Therefore, I wrote a shell script restart. sh to restart the instance by calling the stop and start commands. At first, I used the exec command to call the stop. sh and start. sh scripts. Stop. sh script, the command is executed and released, and the start is not called. sh script to view the stop. sh script content, found that there is a command exit, resulting in command execution now exit. I wanted to get rid of the stop. sh script and thought it was not as good as the original service script content, so I didn't change it! The Command Script www.2cto.com is as follows: exec./stop. shexec./start. sh. Then, after removing the exec command, it will be available. No matter what the previous stop. sh script executes or whether the execution is successful, it does not interfere with the execution of the following commands. This is the desired effect, so exec is used to achieve the desired effect. The modified Command Script is as follows:./stop. sh./start. sh author wkm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.