1. DemandThe collection task constructs the storage. To achieve the title, time, content and other information of more than 200 Web site collection information configuration, and inserted in MySQL.2, Implementation Step 1: Manual implementation of
The company now needs to make regular backups of the existing servers and place the backup files in the NAS being used;For the efficiency of backup, we also need to filter the backup files and exclude some files with suffix names.The implementation
1.psReview the process. It only shows the processes that are currently user-owned under the current console, including bash and PS commands themselves.2.topReal-time detection process. The first line of the output shows an overview of the system
Function Description: Tell the shell to remove the eval parameters and re-calculate the contents of the parameters.Syntax: eval [parameter]Supplementary Note: Eval can read a series of parameters and then execute according to the characteristics of
Condition test: Recommended format 2Format 1:test man test See Related HelpFormat 2: [Format 3: [[Description: A wildcard character can be used for pattern matching in [[]] && | | > [[email protected] ~]# test-f file && echo 1 | | Echo 00[[email
Because the shell appears to be a common feature between UNIX systems and is standardized by POSIX. As a result, shell scripts can be applied to many systems once they are "written attentively". Therefore, the reason to use shell scripts is based on:
Open a text editor, create a new file, the extension sh (sh for Shell), the extension does not affect the execution of the script, see the name is good, if you write a shell script in PHP, the extension is good with PHP.Enter some code:
Noun Explanation:Cron system scheduling process that can run jobs at a certain time interval or at a fixed point in time& Use it to run a process that takes a long time in the backgroundNote:Cron is a system scheduling process that can run a job
The cue color in the shell terminal is determined by the PS1 in the environment variable, so change the PS1.1> Temporary changes[[Email protected]~]# echo $PS 1 [\[email protected]\h\w]\$ [email protected]~]# ps1= ' \[\033[31m\][\[email prote
Recently installed VSFTPD to do FTP service, found that the system user login shell is set to/sbin/nologin, you cannot use the FTP service. Online data said that VSFTPD will be for each FTP login user to check the corresponding login shell
-eq equals-ne Not equal to-GT Greater than-lt less than-le less than or equal to-ge greater than or equal to-Z Empty string= Two characters equal! = Two characters are not equal-N Non-empty stringStrings are commonly used to check user input,
This article is part of the Linux Shell Series tutorial (17), more Linux shell tutorials: Linux Shell Tutorials
Through file inclusion, you can reference the contents of other files, or you can separate complex content to make the program
loop control and functionsBreak loop control, continue loop control.Loop control characterThe break loop control can be used to exit the entire loop;After exiting the loop, the following loops are executed, using the Continue loop
Conditional Judgments in shell scripts
1.if [Condition];thenStatementFi2.If [Condition];thenStatementelif [Condition];thenStatementElseStatementFi
Note the point:1-1. If and fi are paired, a syntax error occurs when
5.1 FunctionsFormat:Func () {command}Example 1:#!/bin/bashfunc () {echo "This is a function."} Func# Bash Test.shthis is a function.The shell function is simple, with the function name followed by a double parenthesis and the double curly brace.
The difference between an array and a variableVariables: Storing the memory space of a single elementArray: A contiguous memory space that stores multiple elements, equivalent to a collection of multiple variablesArray = array name + indexIndex:
Shell scripts are extremely important in operations, and the use of arrays in shell scripts is a very useful aspect in both looping and computing.Here are some operations on the array aspects of the shell script to record here, hoping to help
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