Recently managed a number of machines, there is a need to unify the change of an account username password, such as the QA account password changed to 1234, and later for scripting, very convenient implementation, but also used to modify the user's
function can make a similar custom execution command in shell script, the biggest function is to be able to simplify many of our program code. It is important to note that the shell script is executed from top to bottom/left to right, so the
It is not a programmer's job to tailor an icon of every size needed to the shelves one at a time before the app is put on the shelves, and using the SIPs tool from the MAC can solve this requirement.With respect to SIPs, the following information
The Asia Pacific Network information is recorded here, updated every day.
Http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest
The following script will edit this text, output several major network segments of the domestic operators.
Basic knowledge
Shell execution Mode SH xx.sh (file must have R permission) | | ./xx.sh (file must have X permission) Note: Sh xx.sh method is more safeFileName suffix. shShell content Opening #!/bin/bash | | #!/bin/sh | | #!/bin/csh | | #!/bin/ksh
The Shell Case statement is a multiple-selection statement. You can use a case statement to match a value with a pattern, and if the match succeeds, execute the matching command. The case statement is formatted as follows:
Copy Code code as
Nowadays many people like to use spaces when they are named, such as "an Introduction.doc". But this naming problem is confusing to Linux command-line tools and shells, because most commands use whitespace as a separator between values and values,
If your directory level is very deep, this shell will be very convenient to switch directly to the destination directory, such as
Current directory/usr/home, and directory Desdir in/usr/home/app/local/opp/william/desdir
Direct penetration
$ CD
In the loop, sometimes you need to force out of the loop when the loop end condition is not reached, like most programming languages, the shell also uses break and continue to jump out of the loop.Break commandThe break command allows you to jump
We can pass parameters to the script when we execute the Shell script. The format for getting parameters within a script is: $n. (n represents a number, 0 is the name of the shell script executed, 1 is the first argument to execute the script, 2 is
The color of the text terminal can be generated by using the ANSI unconventional character sequence. Example:
echo -e "\033[44;37;5m ME \033[0m COOL"
The above command sets the function as follows:
The use of BeanShellIn this introduction, the use of BeanShell preprocessor, other beahshell can be analogous. In this we use the Beahshell call ourselves to write the tool class, the tool class implements the password encryption, decryption
1. Analog Linnux Login Shell#/bin/bashEcho-n "Login:"Read nameEcho-n "Password:"Read passwdif [$name = "CHT"-a $passwd = "abc"];thenecho "The host and password is right!"else echo "Input is error!"Fi2. Compare two number sizes#/bin/bashecho "Please
1. Code is simple, but difficult to verify, not as good as Python understandingIt is recommended to edit under notepad++.2. Note the ' Yes ' tab key that references the Linux command.3.if[] HereError:syntax error near unexpected tokens ' then 'Cause:
The code is as follows:1#!/bin/SH2 #################################################################3 # Author:91coder4# blog:www.cnblogs.com/91coder5 #################################################################6 7 # Create a
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