Shell Learning Example One

Enterprise Face question 1:Use the For loop to create a batch of 10 files in the/oldboy directory, with the name in turn:Oldboy-1Oldboy-2Oldboy-3......Oldboy-10Hint: In the future to test everyone file prefix is also random, the end is a number

Reproduced Shell deletes scripts for various annotations

Transferred from: http://www.cppblog.com/zhangyq/archive/2010/10/08/127915.html1.txt content:File contentAabbccAbcdefgHilkdifdfdfMmmmmmmmEeeeeeeeeeeeeeComment Part 2>>>DdeeffSED-E ": Begin; />>/{/>>>/! { $! {N; b begin}; }; s/>>//; };" 1.txtFile

CentOS Shell Basics 2015-4-8 12th Session

CentOS Shell Basics 2015-4-8 12th SessionThe first half of the classThe second half of the classHistory: Command history, save 1000 commands by default!! : Previous command!$: Last parameter of previous command!n: Executes the nth command in the

Shell Exercises Explained

Write a script that calculates all the odd and all the even numbers within 100 and displays them separately#! /bin/bashSum1=0For i in ' SEQ 1 2 100 'Dosum1=$[$sum 1+ $i]Doneecho $sum 1Sum2=0For j in ' SEQ 2 2 100 'Dosum2=$[$sum $j]DoneEcho $sum

Shell base-bash variable-user-defined variable

Variable setting rules:Variable names can consist of letters, underscores, and numbers, but cannot start with a number.The default type of a variable in bash is a string type, and if a numeric operation is required, specify the variable type as

Shell Script Job

(1) Write a script: If a path does not exist, it is created as a directory, otherwise it is present, and the content type is displayed#!/bin/bash#if [$#-lt 1]; Then echo "Plz Enter a path:" Exit 1fi if [-e $]; Then file $1else mkdir-p $1fi ~Test

Robotium shell command for cross-process automated testing through broadcast and service +shell commands

This is the weekend when you want to put out the shell, the results, Saturday overtime, plus the class and friends out to play, Sunday and stole a lazy, the results of the weekend did not do anything, with the development of the boss said the

Dubbo Official Shell startup script (with JVM parameters)

#!/bin/bashcd ' dirname $ ' bin_dir= ' pwd ' CD. Deploy_dir= ' pwd ' conf_dir= $DEPLOY _dir/confserver_name= ' sed '/dubbo.application.name/!d;s/.*=//' conf/ dubbo.properties | Tr-d ' \ r ' server_protocol= ' sed '/dubbo.protocol.name/!d;s/.*=//'

Linux System Shell Brief

1 , describes the operation principle of shell program (can be attached with necessary graphical description);What is a shell?The shell acts as the shell of the operating system, providing the user with an interface to use the operating system. It

Shell Calculation Tool Source code

#!/bin/bash# defines greatest common divisor and the minimum number of conventions gcd_result= "lcm_result=" "#定义一个相加的函数function  sum ()  { result=$ (  num1+num2 )   echo -e  "\033[31m  two number of $result \033[0m"}# Define a greatest common

You may not know the shell

The shell is also called the command line interface, which is the interface between the user and the computer under the *nix operating system. The word shell refers to the program in the operating system that provides access to the kernel

Shell statistics Word Frequency script

  #!/bin/bashif [$#-ne 1];then echo "usage:$0 filename"; Exit-1fifilename=$1egrep-o "\b[[:alpha:]]+\b" $filename | awk ' {count[$0]++}end{printf ("%-14s%s\n", "Word", "Count"), for (Ind in count) {printf ("%-14s%d\n", Ind,count[ind]);}}

Operations Common Shell

List The 10 shells you use mostHistory | awk ' {a[$2]++}end{for (i in a) {print a[i] "i}} ' | Sort-rn | HeadHistory | awk ' {a[$4]++}end{for (i in a) {print a[$i] " " i}} ' | sort-rn | headgrep-v "#". Bash_history |awk ' {++a[$1]}end{for

Common Linux Commands Explanation (sixth day)--shell environment variables

Too lazy, these days seem to have been lazy cancer, do not want to write a blog. Later think about, knowledge, or share the good. The first to cure their own lazy cancer; second, consolidate your knowledge by the way. There are two types of

Common Linux Commands Explanation (fifth day)--shell variable learning

Due to the limited time, I wrote this blog for a maximum of 30 minutes. Only as a study note, the content will be as clear as possible. If you don't know what to say, you can hit me! Joke opened, formally began today's study.Some of the

Linux hard disk usage and Shell script implementation

Use df-tph to view hard disk usage under Linux:sdua:/# Df-tphfilesystem Type Size used Avail use% mounted On/dev/vda3 ext3 2.0G 974M 940M 51%/udev tmpfs 16G 500K 16G

Linux Shell learning comes in mind

The Magical magic of awk:Extract the number 600 and note the special effect of the + sign.echo "Fuck 600ms" |awk ' {print + $NF} 'Result: Other characters are filtered, leaving only the number 600Using If,for in Commad mode#测试ifa=200if [$a = =];then

Shell Array related Operations

Reference: http://www.cnblogs.com/chengmo/archive/2010/09/30/1839632.htmlCreate an arrayA= (12345)Get array length${#a [@]} #${#变量} to get variable length ${#a [*]}Print array ContentsEcho ${a[@]} #echo $a print only the first element of the

Linux shell array creation and usage tips

Switch from Linux shell array creation and usage tipsThe Linux shell is much more powerful in programming than Windows batch processing, both in loops and operations. Data types are not comparable. Here's a summary of some of the things that an

Java implementation of Shell sequencing

PackageCom.edu.hpu.sort.insert.shell;Importjava.util.Arrays;ImportCom.edu.hpu.sort.Sort; Public classShellsortextendsSort {@Override Public int[] Dosort (int[] arr) { intLen =arr.length; //all step probabilities (for the first half of the

Total Pages: 541 1 .... 368 369 370 371 372 .... 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.