Linux Learning –shell Scripts

The shell is a bridge between command and hardware.The shell works in two ways: interactive, batch dispositionInteractive: A user enters a command at a time, the shell translates and executes aBatch processing: The user makes multiple commands into

The operating environment of the Bash shell

Path and command search orderBash Pit WelcomeBash Environment configuration fileTerminal settingswildcard characters and special symbolsThe TTY1~TTY6 command interface reads some key settings for the local computerUse Stty to view key contents[Email

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

Where to look in the shell

[Email protected]_48_191_centos 456]# vim 2.sh#!/bin/bash #加入这行, which means that the interpreter is bash, no plus, I'm CentOS, the default is bashEchoecho $[Email protected]_48_191_centos 456]#/2.sh 1./2.sh1[Email Protected]_48_191_centos

Shell input and output redirection

Standard input: 0 Standard output: 1 >,>> or 1>,1>>Error Output: 2 2>>,2>/dev/null 这个设备,是linux 中黑洞设备,什么信息只要输出给这个设备,都会给吃掉 Send standard output, error output to/dev/null$ ls test.sh test1.sh >/dev/null 2>&1,1 represents the standard output 2

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 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 '/

Seq in the shell magical

Add 20 users to the CLASS01 group in bulk, the user name begins with STD, ends with a number, format: STD01---STD20Method 1#!/bin/shgroupadd class01a=stdfor ((i=1;iMethod 2:#!/bin/bashgroupadd class01for i in {1..20}doif [$i-lt];thenuseradd "std0$i"-

Useful shell Commands

Netstat netstat-print network connections, routing tables, interface statistics, masquerade connections, and Mul Ticast Memberships See Parameters: -A (All) displays all options and does not show listen related by default-

Linux Shell && | |

The && (Command execution Control) syntax is formatted as follows: Command1 && command2 [&& Command3 ...] 1 use && connection between commands to implement logic and functions. 2 only the command on the left of && returns True (command return value $

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

Shell Review First chapter

Today to write blog only to find before there is no written, my God, I was asleep ...1, what is a shell?The shell is a unix/linux system with software that acts as an interface between the kernel and the user, reads the user's input command, sends

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

Shell for loop exercises-equilateral triangle

[email protected] ~]# cat sanjiaoxing.sh #!/bin/bash# Crushlinux# 2017-04-10 Read-p "Please enter the length of the equilateral triangle one side:" Longfor ((a=1;aa;b--)) #控制空格输出 Do echo -n "" Donefor C in ' seq 1 $a ' #输出所在行数相同的数字个数do echo-n "$a"

Special characters of the shell

Bash is a powerful scripting language, which is the default shell in many Linux occurrences, supports variables and special characters, and looks at what special characters it has:; Command delimiter, you can write multiple commands in one line;;

Rookie--shell script to solve the problem

First, the implementation of the discovery of the ADB shell into the device and no longer continue to execute/system/plugin/....ExitAll the online search is bat file call adb shell, no sh file call adb shell does not go down, look for other

Shell script temporary file generation and use, signal capture

Instance: Generate temporary file record Apache process number, kill Apache process, Delete temp file 1#!/bin/Bash2#create_log. Sh3 4#1. Get the process number to all httpd applications5#2. Deposit the process number in a temporary

Shell sequencing of data structures

#SIZE 10Direct Insert Sortvoid Insert_sort () {int i,j;int array[size+1];ARRAY[]={0,12,23,11,55,2,34,18,20,48,22};for (i=2;iArray[0]=array[i];J=i-1;while (Array[0]ARRAY[J+1]=ARRAY[J];j--;}ARRAY[J+1]=ARRAY[0];}}Binary Insert Sortvoid

Minimize other programs in Delphi and all programs to minimize (use Shell.minimizeall and find your own window both ways)

1. Minimization of All ProgramsUses comobj;  var shell:olevariant;begin Shell: = Createoleobject (' shell.application '); Shell.minimizeall;end;2. Minimizing other programsspy++ 查找要最小化的程序classnamevar Indicador :Integer;begin // Find the window

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