71. Special Features of command execution in crontab in shell,/bin/sh

Source: Internet
Author: User

1. When the crontab command is executedProgramIt is a little different and should be noted. For example, PS aux | grep File

If the statement is executed directly in shell, the search scope is only the process currently executed in top, and the crontab statement is written to execute, all statements in crontab become the search range.

Count = 'ps aux | grep file | WC-l'

2. Add/bin/sh in front of the written script

If you want to grant the script execution permission, the first line must declare the script's explanation. For example:

#! /Usr/local/PHP/bin/PHP

#! /Bin/sh

The effect is as follows:/bin/sh scriptname

"#! /Bin/sh "is the shell declaration, indicating that you are using the shell type and its path. It can be understood #! It is a special declaration character.

Reference

[1]Http://linux.die.net/man/1/head

[2] About/bin/sh

Http://www.cnblogs.com/ghj1976/archive/2010/07/12/1775860.html

Related Article

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.