Shift is a very useful command in UNIX. You can move the command parameter to the left so that the command parameter position in the script is not changed, and all parameters are traversed in turn.As Shift 3 indicates that the original $4 now become
#数字段形式For i in {1..10}DoEcho $iDone#详细列出 (characters and not many items)For File in 1 2 3 4 5DoEcho $FileDone#对存在的文件进行循环For shname in ' LS *.sh 'DoName= ' echo ' $shname | Awk-f. ' {print '} 'Echo $nameDone#查找循环 (This method can also be used when
first, how to execute the shell scriptShell scripts are text files, so you can create and edit scripts with any text file editor (such as Vi,emacs, etc.). The name of the shell script file does not have a qualified suffix name, usually without a
Quickly jump to a specific directory in the shellOn the computer to put the project code unified into a directory "~/code", often need to jump from other directories to the code directory, always enter the directory is more trouble, and then think
[This is my own study notes, welcome reprint, but please specify the source:http://blog.csdn.net/jesson20121020]
Shell Script basic elements:#!/bin/bash ---First line # ---comment variable flow control structureLook at a simple example,
If you need to modify the default shell (typically the bash shell), use it handy. Check the shell types available for your system first[email protected] ~]$ chsh-l/bin/sh/bin/bash/sbin/nologin/bin/tcsh/bin/csh/bin/kshModify the current shell[email
Programming on Linux, without the shell, plan to take a good look at Shell programming, and make notes here to share with people of the same interest, primarily in the Shell Scripting Learning Guide.Before you learn shell scripting, you need to
This is the automatic landing SSH script I wrote in St, divided into two filesFile 1:sssh#!/bin/bash#xql 2011/01/4#auto SSH 138.198.230.170Case$Inch "Xql")Sssh.exp XQL ;; "Root")Sssh.exp Root ;; "31" ) SSH [ Email protected]10. 80.117. ; "40" )
One, variableVariables in the shell are divided into: local variables, environment variables, positional parameters;Local variables: Variables that can only be used in scripts for the user's current shell lifetime, local variables are invalidated as
the meaning of several symbols$#: On behalf of the following parameters "number", the above table as an example of this shows as "4";[email protected]: for "$" "$" "$" "$" "$4" means, each variable is independent (enclosed in double quotation marks);
Record command history: The commands we've knocked on, Linux will have a record, saved in the. bash_history file in your home directory. (Note: The current command will be saved in the. bash_history file only if the user exits the current shell
I. BACKGROUNDToday, suddenly found that the latest news thumbnails on the mobile client are not displayed, on the server looked at,Discover that new news images do not generate thumbnails at all.This set of news release system is very old program,
The bash shell itself does not support regular expressions, and the use of regular expressions is shell commands and tools such as grep, SED, awk, and so on;However, thebash shell can use some metacharacters in the regular expression to implement
For example, comparing strings, judging whether the file exists and whether it is readable, etc., usually uses "[]" to represent the condition test.Note: The space here is important. The space to ensure the square brackets. I have wasted a lot of
1. Calculate the length of the array:${#array [@]}2. List the array index:${!array[*]} or ${!array[@]}3. Print all the values in the array:${array[*]} or ${array[@]}Iterate through the array elements in 4.shell:For STR in ${array[@]};DoEcho
Sch encrypts shell scripts 02
Sch encrypts shell scripts 02
I. Introduction
SHC (shell script compiler) is the shell script compiler. Scripts compiled through SHC are not readable for common users. Therefore, if you want your code to implement
Introduction to the ssh "Secure Shell" Protocol
Traditional network service programs, such as ftp, pop, and telnet, are inherently insecure because they transmit passwords and data in plain text on the network, people with ulterior motives can
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