4.1.3 Shell Process Control Statements If condition judgment StatementIf ( expression ) #if (Variable in Array)Statement 1ElseStatement 2FiCase one, test if the directory exists, does not exist then new (note that space must be between the brackets)
4.1.3 Shell Process Control Statements If condition judgment StatementIf ( expression ) #if (Variable in Array)Statement 1ElseStatement 2FiCase one, test if the directory exists, does not exist then new (note that space must be between the brackets)
Environment variables in the shell become global variables and local variables. Global variables take all caps.1.printenvView the global variables for the system.Displays the value of a single environment variable using the echo command.Eg:echo
1, Tail-f/var/log/secureYou will find a lot of login errors. This means that your machine is being violently cracked.2. Create a new shell scriptSave exit.3, join the timing CRONTAB-EI'm judging every 10 minutes here, you can put a little longer.4.
Shell script to generate test dataVim data_create.shRm-rf./data.txtTouch Data.txtFor ((i=0;iDoStr= ', name ';Name=${i}${str}${i}#echo $nameecho $name >> data.txtDoneecho ' Show TestData 'More Data.txtchmod u+x data_create.shRun the scriptSh-x
"Topic link" http://acm.hdu.edu.cn/showproblem.php?pid=5730"The main topic"Give An array w, representing the weights of the fields of different lengths, such as W[3]=5, if the field length is 3, then its weight is 5, and now there is a field of
1. Print Network interface list[touch_more]# ifconfig | cut-c-10 | Tr-d ' | Tr-s ' \ n 'Eth0Lowww.qixoo.qixoo.com//cut-c-10; The first 10 characters of the output;Tr-d "; Delete all spaces;Tr-s ' \ n '; Compress repeated line breaks2. View Name
vim/etc/resolve.conf View DNS6.shell script Commands1.diffDiff file File compares the differences of two files-C Displays the surrounding rows-U generates patches in a uniform output format-R comparison of files in two directoriesPattch file
echo-n non-newline output$echo-N "123" $echo "456" final output 123456 instead of 123456 echo-e handling special characters if the following character appears in the string, it is handled in particular, not as a general text output: \a a warning; \b
Integer operations in shell scripts are generally implemented by the two instructions of let and expr, such as the variable s plus 1 can be written: let "s = $s + 1" or s= ' expr $s + 1 'The two are not easy to write, but the performance of the
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,
Recently need to do a distributed architecture of the site, is currently in the debugging phase, each time the boot to start a lot of tools, such as Zookeeper, ACTIVEMQ, Redis, Nginx and so on, take pains.Search the Internet on the Mac how to set up
Variable Description:$$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return value)$-Flag at a glance using the SET command$*All parameter lists. such as "$*" in the
1) Use of shell ifDetermine if a.txt existsIf [-F a.txt]2) Execution result of the commandAssign the execution result of the command to the variable, the following two methods are the sametime=$ (date +%y%m) time= ' date + $Y%m '3) Find out what we
File type: Normal file, directory file, socket file, device file, link file
determines whether a file is a symbolic link file. Yes, move it to the/etc directory; No, do not handle it .
1 #! /bin/bash 2 #filename: a.sh 3 filename= 4 echo "Input
The company recently built Jenkins on Windows, but the release was published to a Linux server, so there will be a problem with executing the shell command on the automatic deployment, and then looked for it;Discover that Jenkins has a plugin for
Create a DS13 server using Windows Power ShellThe Web page is created first:Virtual Cloud Service (ServiceName): Zampdmp-dsVirtual Network (vnetname): az-dmpnetworkTo create a new DS13, the attachment 800G Disk PowerShell command is as
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