Shell internal commands and external commandsInternal command: is actually part of the shell program, which is a command executed by the shell itself, usually loaded and resides inside the system when the Linux system loads and runs. External
in recent times, when dealing with shell scripts, you have encountered time processing problems. The addition and subtraction of time, as well as the calculation of the difference. Gets the current time stampDate+%s1. The time-plus-minus approach
The part of judgment and inspection can be set or not executed checknginxroot to avoid being subject to permission problems#!/bin/bash#by LCip= ' Ifconfig eth0|awk-f ' [:]+ ' Nr==2{print $4} 'Curl= ' curl-i $IP |egrep "403|200|404" |head-1|wc-l
I. Arithmetic of integers(1) Use Let expression, no need to add ' $ ' before variableLet sum=num1+num2(2) $[ expression ], before the variable can be added $, or not add $SUM=$[NUM1 + num2] sum2=$[$num 1-5] Sum3=$[num1 + 3](3) $ ( expression ),
Special Symbol:&&Note: Also, the left and right sides are two commands, the execution on the left will only execute the command on the side. RightSpecial Symbols: | |Note: Alternatively, the left and right sides are two commands, the command on the
Three days of writing edge test, and finally completed the current longest code script, a total of 253 lines, in 2 machine installation Lamp,lnmp have passed smoothly, the script can be used as a production environment.Where the script needs
This is the 6.828 first section of a small job, is to implement a shell, most of the source code is given, but compile a lot of bugs and warning found, so need to read the source and then change their own.The focus of this assignment is to
Shell commands are usually divided into two categories:Built-in commands (man Builtins)External commandThe difference between the two is analyzed below.Built-in commands:Internal commands are built into the shell. The internal command executes very
CTRL + C Terminal Break programCtrl+d keyboard input end or exit terminalCtrl+s Tentative Current program, pause and press any key to resume operationCTRL + Z put the current program in the background to run, restore to the foreground for command
String test:= =: Determine string equality! =: Judge strings are not equal-N: Tests whether the specified string is empty-S: Tests whether the specified string is not emptyLoop statement:for variable in list; DoLoop bodyDoneExample:For I in 1 2 3 4 5
$ () and ' (anti-quote)In the bash shell, $ () and "(anti-quote) are used for command substitution.The so-called command substitution is similar to the variable substitution we learned in the fifth chapter, which is used to reorganize the command
View shell scripts for Linux server network trafficWhen uploading a large number of files, you can use this script to implement monitoring!#!/bin/sh ## #统计5s内的平均流量, if [ "$" = " ];then echo -" in megabytes e
This paper aims to review the basic concepts of shell, programming model, variable type, script specification, language structure, script execution modeLinux hierarchy and Shell basic concepts
The Linux hierarchy is roughly divided into
Linux Modify shell command prompt and color1. Load the configuration file sequence during the Linux login process:/ETC/PROFILE→/ETC/PROFILE.D/*.SH→~/.BASH_PROFILE→~/.BASHRC→[/ETC/BASHRC]You can view the default ~/.BASHRC file as follows:[Root@~/wade/
-------------------------------------------------------------------------------------------------The types of variables in the shell are all strings by default, so:#!/bin/Bashaa=1bb=2cc= $aa +$bbEcho $cc 1+2Number of ways to calculate:Declare
One, variable
Variables are the use of a simpler string instead of some special-meaning settings and data. Taking path, this path replaces the absolute path of all common commands, and with the variable path, we no longer need to enter the
Linux production server shell script sharing2012-6-6 86 Market Network LinuxAs a Linux/unix system administrator, I often meet people asking this question: what can the shell do? PHP is so powerful, why not use PHP to get the job done? In fact,
Shell Features--Linux has a variety of shell can be used, the default for Bash,bash has the following key features.1. Command Memory AbilityPress the up and down keys on the command line to find a pre/Post input command, which is recorded in ~/.bash_
Http://snailwarrior.blog.51cto.com/680306/154704BASH only supports one-dimensional arrays, but there is no limit to the number of parameters.declares an array:declare-a Array(In fact, you don't have to declare it, you assign it directly to the
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.