1.1 Shell prompt[Email protected] ~]$If the last character is "#", it indicates that the current Terminal session has Superuser privileges. This permission can be obtained by logging in with the root user or using a terminal that provides superuser
1. Examples of error methodsAVar=1+1Echo $varThe result of the output is the same, tragedy, hehebVar=1var= $var +1Echo $varOutput is the same, still tragic, hehe2. Correct method1) Use LetVar=1Let "Var+=1"Echo $varThe output is 2, no tragedy this
1. Definition:The crontab command is commonly used in Unix-and Unix-like operating systems to set instructions that are executed periodically. The command reads the instruction from the standard input device and stores it in a "crontab" file for
Linux bash Shell's declare declare or typeset built-in commands (which are exactly the same) can be used to constrain the properties of a variable. This is a way to use a less restrictive definition type in some programming languages. Command
Basic Regular expression (supports shell tools such as Grep,sed,awk)* 0 or more of the ordinary characters in front of the * character. Match any character^ matches the beginning of the line, or the following character is non$ Match Line End[] Match
The format of the statement is: Getopts The general format is:Getopts option_string VariableWhere option_string contains a valid single-character option. If the getopts command finds a hyphen on the command line, it is compared with the word
When you write a shell script that starts with the Crontab timer task, if the shell script execution time exceeds, Crontab pulls the script time interval, this time may appear the same script simultaneously initiates several times the phenomenon.
function allows us to divide a complex function into several modules, which makes the program structure clearer and the code reuse more efficient. Like other programming languages, the Shell supports functions as well. The Shell function must be
Use crontab you can perform a specified time in the Shell script or a series of Linux command. For example, the system administrator schedules a backup task to run every dayEntry# crontab–eThis enables the edit mode to open the personal crontab
The MAC server needs to turn on Telnet first. Open with: System Preferences, share check remote loginCommon commands are:Copy (copy the native file to the remote server) Scp-r Local path/file userName@192. 168. XXX. XX:/tmp#userName为远程服务器用户名称,
CTRL r: Command line appears reverse-i-search, input character will match command in input historyCTRL P: Go ahead and look through historyCtrl N: Looking back over historyCtrl A: Command headerCtrl e: Command line endCtrl F: Jump forward one
In a shell script, you can perform numerical calculations,如加减乘除,通过expr、let、(())等完成,文章介绍:http://blog.csdn.net/longshenlmj/article/details/14166193但是上面的运算只支持整数。小数计算怎么办?Shell small number calculationComplete with Bc,awk and Nawk tools, etc.The code for
Recently writing a shell script, I would like to use a For loop to read the contents of the file, but found that every line in the file has a space, obviously with a for loop does not work, my intention is to read a row of the file content, so
1. Create a script that can add script information to other scripts:#vim cs.sh#!/bin/bashCat > $ #!/bin/bash#Name: ' BaseName $ '#Description:#Author: TEST#Version: 0.0.1#Datatime: ' Date ' +%f +%t "'#Usage: ' BaseName $ 'EofVim +8 $2. Modify the
Shell Script (iii)2. File sorting, merging and segmentation(1) Sort command#-c: The test file is sorted;-K: Specifies the sort field;-M: merges two sorted files;#-n: Sort by number size;-o: Writes output to file;-r: Reverses sorting results#-t:
Recently found in the group feedback, login layer can not successfully enter the user name password situation, roughly looked at, a little summary:I encountered the login can not successfully enter the user name password situation there are two, one
Shell programming notes, shell programming1. Bash variableUser-Defined variables # local variablesEnvironment Variable # global variableLocation Parameter VariablePredefined VariablesX = val # value assignment$ X # CallThe default value of 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.