' and $ (), eval, crontab in the shell

Source: Internet
Author: User

The difference between one, ' and $ ()

The anti-quote itself escapes the \, retains its own meaning, and if we want to play a special meaning in the anti-quote, we must use 2 \ to represent it.

in inverted quotation marks: \ \ = \

$ () in: \ = \

Note: Anti-quotes are old usage, $ () is a new usage, whether in the learning test, or in the actual work, the usage of $ () is recommended.

Second, the eval command

Eval will scan two times for subsequent commands, execute this command if the command is a normal command after the first scan, and if the command contains an indirect reference to the variable, the semantics of the indirect reference is guaranteed.

For example, there is a file test1, and the contents are "This is a test". When assigning Test1 to test2, (i.e. test2= $test 1). The result of Echo $test 2 is: test1. The result of using the eval command (Eval $test 2) is: The is a test.

Eval in the shell does not get the result of the function processing; eval nesting is meaningless, and eval in the shell executes the following eval command as a command string without nesting, nesting is replaced by command substitution.

iii. crontab Order

The crontab command is used to install, delete, or list tables used to drive the cron daemon, and the user places the sequence of commands that need to be executed in the crontab file for execution.
Each user can have their own crontab file,/var/spool/cron under the crontab file can not be directly created or directly modified, the Crontab file is created by the CRONTAB-E command.
In the crontab file, how to enter the command and time to execute, each row in the file contains six fields, the first five of which are the time the specified command was executed, and the last field is the command to be executed.
Spaces or tabs are used to separate each field. The format is as follows:
Minute hour day-of-month month-of-year day-of-week commands
Legal value 00-59 00-23 01-31 01-12 0-6 (0 is Sunday)

In addition to the numbers there are several special symbols that are "*", "/" and "-", ",", * represent all the values within the range of numbers. "/" stands for each meaning, "/5" means every 5 units, "-" stands for a number of discrete numbers from a certain number to a digit, ",".

-L Displays the current crontab on the standard output.

-R Deletes the current crontab file.

-e Edit the current crontab file using the editor referred to in visual or editor environment variables.

When you finish editing, the edited file is automatically installed.


This article is from the "11441519" blog, please be sure to keep this source http://11451519.blog.51cto.com/11441519/1836549

' and $ (), eval, crontab in the shell

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.