Write a script/root/bin/yesorno.sh, prompt the user to enter Yes or no, and determine whether the user entered Yes or no, or other information
#!/bin/bashread-p "Put your answer (yes or no):" Answercase $Answer iny| y| [YY] [EE]
One, parenthesis, round brackets () 1, single parenthesis () ① command group. The commands in parentheses will be executed in a new sub-shell sequence, so the variables in parentheses cannot be used by the rest of the script. Multiple commands in
-shell online 30 min- û please copy the code below with the virtual machine liunx Under the main file named xxx.sh; terminal runs can simply enter ./xxx.sh to run but there can be problem resolution 1:vim yyy.sh
First, calculate the value of 1+2+...+100Use the General method: #! /bin/bash sum=0 res= "" num=1 for ((; numThe results are as follows:650) this.width=650; "src="
Sort-u and Uniq can play the role of removing duplicate information, so where is the difference between them?$ cat TestJasonJasonJasonFffffJasonThe following three commands are executed separately1:sort-u TestSort-u TestFffffJason2:uniq Test$uniq
There are 3 ways to execute the shell script:
Bash xxxxx.sh or SH xxxxx.sh (recommended)
Path/xxxxx.sh or./xxxxx.sh (Execute script under current path)
SOURCE xxxxx.sh or. Xxxxx.sh (there is a space behind the dot.) This way you can put
before starting the code, let's take a look at what a shell is. Shell English is also called the shell layer. In a computer, "system" software that "provides user interface", usually refers to the command parser of the command line interface. In
EvalThe role of Eval is to perform command-line processing again, that is, to perform two command-line processing on a single command line.Syntax: eval cmdlineEval will scan the back of the CmdLine two times, if CmdLine is a normal command after the
before starting the code, let's take a look at what a shell is. Shell English is also called the shell layer. In a computer, "system" software that "provides user interface", usually refers to the command parser of the command line interface. In
There was a problem compiling the VPP project on the FEDORA20 system today, and in the final compilation and the RPM installation package generated using Rpmbuild is incorrect, we need to make some minor changes to the spec file that generated the
Requirements: Read IP addresses and port numbers from a file, open the IP and ports with Iptablessuch as file content:[email protected] huwei]# cat ip.txt192.168.66.20 22192.168.66.30 10050192.168.66.30 33The manual action is:[[email protected]
Some time ago, just came to practice, because their development machine environment has not yet been equipped with the boss of the machine, opened, Yi ~! Why not traditional linux [[email protected]]? This aroused the baby's great curiosity (why the
1. Find all files larger than 500M in the current directory, write them into a text file, and count the number of files.Find./-size +500m-type F | Tee File_list | Wc-l2. Locate 100 files starting with ABC in the Directory/TMP and save the first line
1. IfSyntax format for IFif Conditon Then Command1 command2 " commandnfi2. If Elseif Conditon Then Command1 command2 " commandnelse Command1 Command2 "' commandnfi3. If ElseIf elseif Conditon Then
A Basic introduction1.awk:Awk is a powerful text analysis tool that is irreplaceable in the processing of text files and generating reports. Awk considers text files to be structured, which defines each input row as a single record, each string in
Shell-6.shell Read commandRead--Reads the information from the keyboard or file and assigns it to a variable1. Read variable nameInstance[email protected] home]# cat name.sh#!/bin/shEcho-n "Please input your name:"Read nameecho "Name is ${name}"Show
Shell Special variables1. Special variable names and meaningsVariable name meaning$ A script nameLocation parameter #1$-$9 positional parameter #2-#9${10} positional Parameters #10$# number of positional parameters sh test.sh XX YY, $ #就是2 is the
Four letter DTU and peanut Shell configuration Application in industry or industrial control monitoring management, mainly wireless remote monitoring, and everyone in the common use ofDTUor industrial routers and other wireless digital transmission
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