Shell level Two Menu

Today the weather is cloudy, a little bored, so boring to play like ...#!/bin/bash#date:2017-6-20#version:1.0#author:xcn ([email protected]) menu  () {Cat This article is from the "Little Rookie" blog, please be sure to keep this source

Linux Shell & placed behind the startup parameters to set this process as a background process

& placed after the startup parameter to set this process as a background processBy default, the process is the foreground process, then the shell is occupied, we can not do other operations, for those who do not interact with the process, many times,

Shell scripts 6--loops, comparing

For loopfor var in list;Docommands, #使用变量 $varDoneExampleFor I in {A.. Z}; do actions; DoneLatterFor ((i=0;i{Commands}While conditionDoCommandsDoneUntil cycleExamplex=0;Until [$x-eq 9];DoLet x + +; echo $x;DoneIf comparison statementif

Shell determines whether a folder or file exists

The folder does not exist and is createdif [!-d "/data/"];thenmkdir/dataelseecho "folder already exists" fiFile exists then deleteif [!-F "/data/filename"];thenecho "file does not exist" Elserm-rf/data/filenamefiDetermine if a folder existsIf [-d

Shell condition Test Statement if

Tag: Shell expression exists * * * Specify dir DIA statement return resultIf condition statement: The IF condition statement is divided into single branch structure, double branch structure, Multi-branch Structure-------------------------------------

Shell Programming (i)

Post Address: http://keep88.blog.51cto.comBo main name: Li ChangmingThis note is from------and the old boy learn Linux OPS "shell programming Combat"Directory:Core basic knowledge and practice of shell variables1. Variable type:Environment variables

Shell Foundation Part3

Shell BasicsIntroduction to environment variable configuration file1, the role of the source command is to force the environment variable configuration file, the format is: the source environment variable configuration file or. environment variable

Tips for Linux Shell scripts--not updated regularly

This article is intended to accumulate a solution to small problems that are encountered when writing shell scripts at ordinary times. There are occasional updates here for later review and continuation.One, define the default values in the shell

Shell's common script

1 Batch Create users:#!/bin/bashI=30Groupadd Class2While [$i-le 50]DoIf ID user$i &>/dev/nullThenecho "This user$i is exist"ElseUseradd-g class2 user$i && echo "User$i" | passwd--stdin user$i &>/dev/null && echo "This user$i is created"Fi((i++))Done2

Basic Process Control for shell scripts

If ElseRead-p ' Please enter the score: ' Scoreif [$score-lt 60]; Thenecho ' 60 points below ' Elif [$score-lt 70]; Thenecho ' 60-70 minutes between ' elif [$score-lt 80]; Thenecho ' 70-80 minutes between ' elif [$score-lt];thenecho ' 80-90 minutes '

[Shell programming] Preface

1. Purpose(1) Shell knowledge Summary. Good memory is better than bad writing, finishing the relevant shell knowledge and combining their own practical experience to organize, the content will not involve all the knowledge points, will only cover

About variable settings in the shell

Defining variablesA=Assigning values to variablesA=5' Number equals $ ()[Email protected] ~]# hostnameLocalhost.localdomain[Email protected] ~]# a= ' hostname '[Email protected] ~]# echo $aLocalhost.localdomain${-} to determine whether the variable

Shell DD Backup System

Backing up MBR, root partition, boot partition#!/bin/bashBak_dir=/mnt #已挂载的移动硬盘或其他外设Mbr= ' fdisk-l |grep ' Disk ' |awk nr==1 ' {print $} ' |awk-f '/' ' {print $} ' |sed s/://g 'root= ' df |awk '/\//{print} ' |awk nr==1 ' {print $} 'boot= ' df |awk '/

Linux Shell nature and how it works

The nature of the shell The shell of the Linux system is equivalent to the "one shell" of the operating system, which is the command language interpreter, which provides the user with an interface to use the operating system. It does not belong to

Summarize the 8 tips you use frequently with shell command line

Original blog, reproduced please indicate the sourceThe shell is the command interpreter.See which shells are supported by this system1 Tab Command completionThis almost every time can be used, for example, I have a file called file.txt, assuming

Shell parameter expansion

Using SH to write small scripts can make the job easier. Part of the content may be more unfamiliar to everyone (at least I am).is the variable related to the expansion, the following are some simple description and use of the method. To make the

Shell's awk

Brief introductionAwk is a powerful text analysis tool, with the search for grep and the editing of SED, which is especially powerful when it comes to analyzing data and generating reports. To put it simply, awk reads the file line-by-row, using

Linux Shell Programming Commands-linux Basic Environment Command Learning notes

1. Regular expressions1) ^ Start * Previous character repeats more than 0 times+ More than 1 times? 0 or 1 times. An arbitrary character (. *){m,n} m to n times[0-9] [A-z] any number or letter$ end Character2) sed and awk commandsSed ' match

The Select loop in the shell uses

Select Use AloneCat select01.sh #!/bin/bashecho "which car do you prefer?" Select CAR in Benz Audi volkswagendo Breakdoneecho "you chose $CAR"Run resultsSH select01.sh which car do you prefer?1) Benz2) Audi3? 1You chose BenzSelect and case are used

Java Learning notes-sorting algorithm of hill sort (Shell sort)

The head of the Sunset Building, the voice of the hung, Jiangnan wandering. The Wu hook to see, the railing shot all over, no one will, boarding meaning. --Deng Jiankang and Heart PavilionThe hill algorithm is a sort algorithm proposed by Hill

Total Pages: 541 1 .... 518 519 520 521 522 .... 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.