Part of the Shell exercises (continuous update)

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]                 

The role of various parentheses in the shell

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

"DAY2" a shell script that needs to be used in full Hadoop distribution mode

Cluster remote replication (distributed by Namenode)---------------------------------------#! /bin/bashif [$#-lt 1]; Thenecho no argsexit; Fi#get first argumentarg1=$1;cuser= ' WhoAmI ' fname= ' basename $arg 1 ' dir= ' dirname $arg 1 ' If ["$dir" =

Small code SHELL 30 minutes online

  -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   

shell--Simple Exercises

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="

The difference between the Linux shell de-uniq and sort

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

How to execute a shell script

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

Make your own Linux-->shell

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

Shell script eval, ' and $ (), [[and] [, $ (())

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

Make your own Linux-->shell

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

Linux shell commands and regular expressions

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

Shell Scripting Learning

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/82/94/wKiom1dbsIGDuCnRAAH8FIk-588267.png "title=" QQ picture 20160611143136.png "style=" Float:none; "alt=" Wkiom1dbsigducnraah8fik-588267.png "/>Shell script: Data batch processing, Task

The shell gets the data from the file and assigns it to the variable

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]

Let your shell command prompt fly up ~

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

Shell Instance Collection

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

Shell Basic Learning (vi) Process Control

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

awk in the shell script

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 command

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-3.shell Special variables

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

Intranet version of Peanut Shell to solve the problem of no public network IP, combined with four-letter DTU use

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

Total Pages: 541 1 .... 256 257 258 259 260 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.