Write at the beginning, always write wrong, seemingly simple function, but must be careful; function definition:Funciton functionname {...} There must be a space between functionname and {! I just did not add a space, has been an error.Implement two
How to use: Date [-u] [-D DATESTR] [-S datestr] [--UTC] [--universal] [--DATE=DATESTR] [--SET=DATESTR] [--help] [--version] [+f ORMAT] [MMDDHHMM[[CC]YY][.SS]]Description: Date can be used to display or set the system's Day and time, in terms of
##### #shell Script ##########Bash Script BasicsBASH = GNU Bourne-again Shell,bash is a project developed and promoted by the GNU organization.Bash scripts are similar to batching, simply by putting a lot of instructions together and providing loops,
One, parenthesis, round brackets () 1, single parenthesis () ① command group. The commands in parentheses will be executed in a new sub-shell sequence, so the variables in parentheses cannot be used by the rest of the script. Multiple commands in
The default Simplified Chinese character encoding on Windows is GBK, while Linux is UTF-8 (The description here doesn't seem to be accurate, and the character encoding and character set should not be the same, not clear.). To view the file encoding:(
This article will aim to implement regular automatic backups of the MySQL database, and introduce the perfect collaborative process between shell scripts and scheduled tasks. Where the shell script is responsible for the specific backup operation,
Shell script Programming-case OneProgramming Requirements:1. Create a Vm-ctl script, under/bin/2. Implement features: Create a virtual machine, create a virtual machine snapshot, turn on a virtual machine, display a virtual machine, stop a virtual
Recently debugged a script, in one environment, normal operation, in another server environment, the error "BC: Command not foundFind the following problems:The Linux character interface also has the calculator, that is bc!The operating method is
1. The prototype of the variables in the shell: ${var} Execution of a sequence of commands#等价于 $ var=echoEcho2. Command replacement $ (cmd) execution of a string of commandscommand to replace $ (cmd) and sign ' cmd ' (note that this is not a single
1.11.1 command SubstitutionUse the reverse quotation mark "'" (on the key of the wavy line) or $ () in Linux to perform command substitution. Generally more intuitive and more convenient to knock in $ (). [Email protected] tmp]# echo Can You tell me
Easy-to-make errors with shell scripts1. For i in X y z: This sentence is delimited by a space, and when our $n contains spaces, there will be errorssuch as for i in ' LS *.mp3 ', this ls *.mp3 after execution if there is a space on GGDirect for I
ls/usr/bin/The info# path Operation dirnamebasename# "" and "and" in the shell variable "" allows references to other variables by means of "" prohibit reference to other variables, as ordinary characters ' output of the command execution to the
#!/bin/bash # # Method 1a=1234;echo "$a" | [-N ' ' sed-n '/^[0-9][0-9]*$/p ' "] && echo string A is numbers the first-n isShellTest flags, test for the subsequent string "' Sed-n '/^[0-9][0-9]*$/p '", and if not NULL, the result is true. SED shows
In some complex Linux maintenance work, a lot of repetitive inputs and interactions are time-consuming and error-prone. Scripts are needed.The benefits of scripting: batch processing, automated completion of maintenance, reduction of the burden
First, what is the shellThe shell is both an executable program and a programming language. as an executing program, it interactively interprets and executes user-entered commands , and is a bridge between the user and the Unix/linux; as a
2016-08-18Content of the lesson:Shell Programming Basics (select loops and menus, functions)Yum Management, custom Yum WarehouseSelect loops and MenusSelect variable in listDoCircular Body CommandDone1. The Select loop is used primarily to create
SSH is the abbreviation for secure Shell, which is developed by the IETF Network Working Group, andSSH is a security protocol based on the application layer . SSH is currently a more reliable protocol that provides security for Telnet sessions and
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