Common Linux shell Script records

Traverse directory where all files are directories or files for file in. /* do if test-f $file then echo $file is the file fi if test-d $file then echo $file is the directory FidoneFilelist= 'ls./Proto 'Echo$filelist

Shell concurrent multi-process simultaneous execution

1#!/bin/Bash2 3send_thread_num= -#设置进程数. 4tmp_fifofile="/tmp/$$.fifo"# The current process ID number that the script runs as the file name5 Mkfifo "$tmp _fifofile"# Create a new random FIFO pipeline file6Exec6<>"$tmp _fifofile"# Definition File

[Note]shell Basics of function usage

Functions: Naming rules are the same as variablesExecuting functions in the current shell processModularity of the program for easy maintenanceBasic function Syntax:        function  function name ()          {             Command Area          }    

Shell Operation details finishing (not completed)

In the process of learning Linux, have encountered some small problems, although may be insignificant, but in the pursuit of details often will be more tangled (obsessive-compulsive disorder), empty a blog post space, record some details on the

Linux Shell Common commands daily one more

Freshman semester to learn the basic operation of Linux, has not been used for a long time, the virtual machine has not opened nearly half a year (as a computer professional juvenile really should not). To replenish this knowledge and lay the

Tomcat Maven shell script saves time and effort

Modify the Tomcat Server.xml to unpackwars= "false", and then Maven generates a. War with two functions:1 No manual decompression required. War (Tomcat is not automatically decompressed if there is a folder with the same name and a war with the same

1.2 Shell variables

#系统变量Env View System Variablesecho $HOSTNAME View variable contentsSet view system environment variables, also display user-defined variables, compare all#用户自定义变量a=1;b=2 Defining variablesecho $a $b output variable value#引用变量执行结果Myvim= ' which vim '#

Application of select in shell scripts

Select is also a kind of loop, it is more suitable for use in the case of user choice.For example, we have one such requirement, after running the script, let the user go to select the number and then execute the command!#!/bin/bashselect Mysql_v in

Shell intercept Log Statistics link count log ip

Get logs by time periodSed-n '/22\/dec\/2015:00/,/22\/dec\/2015:50/p ' localhost_access_log.2015-11-10.txt >/tmp/acc.www.log sed-n '/22\ /dec\/2015:00/,/22\/dec\/2015:50/p ' localhost_access_log.2015-11-10.txt |head-3 sed-n

Some tips in the shell

Bash is currently a more popular type of shell under Linux, and the following are some of the scattered things that are recorded in the learning process. Tidy up for forgetting!1. Transfer of function parameters1) Variables in the script that

Shell Learning notes-conditional judgment

1. Judging the format1) Test parameter fileExample: Test-e/root/install.log2) [parameter file]--Recommended useExample: [-e/root/install.log]Note: Spaces are required after and before the brackets2. determine file type parameters1)-D file: Determine

Shell Script Implementation command line multilevel menu (no specific function)

#!/bin/bash#auth chentp0601#date 20151123Function menu (){ClearCat #this is Base menu1.[install Lamp]2.[install LNMP]3.[exit]EofRead-p "Please input 1-3:" ListCase $list in"1")While TrueDoMenu_lampDone;;"2")While TrueDoMenu_lnmpDone;;"3")Echo-e

Linux shell variables get execution results

Linux shell variables get execution resultsThe method of assigning the result of a command to a variable is:1, use the anti-quotation mark "(number key 1 left key, TAB key above, English way input)such as: A= ' echo ' Hello World ';Assigning the

Linux Shell Learning notes-compare operations

integer comparison-eq equals, as:if["$a"-eq"$b" ]-ne not equal to, such as:if["$a"-ne"$b" ]-GT greater than, as:if["$a"-gt"$b" ]-ge is greater than or equal to, such as:if["$a"-ge"$b" ]-lt less than, such as:if["$a"-lt"$b" ]-le less than equals,

How to test the correctness of shell scripts

In the actual work, the shell script needs to be tested for correctness.How to test in the quickest and most effective way?A lot of development habits are, apart, write/Get, run a, see input, output, want to do the operation is completed, also

Shell script Programming {2} per day

redirect$echo "Test Redirect" > Temp.txt--Writes the output to the Temp.txt,temp.txt file is first emptied.$echo "Test redirect Second" > Temp.txt-Append the output to the temp.txt.File descriptor0--stdin Standard Input1--stdout Standard

Shell script standard Output

1. REDIRECT standard output (stdout) and standard error output (STDERR) to two different files respectivelywhere the symbol ' > ' defaults to the standard output redirection, meaning and ' 1> ' the same, ' 2> ' indicates a redirect standard error

The shell thing.

Which language is most helpful to you in your daily work? I think it's a non-shell. The earliest contact with the shell should be in college, such as the Linux file system cut will use some commands, such as Find, tar, Xargs, CP and so on, and put

Linux, Shell scripting Brute force user name and password

Because some registered user account rules can follow, and usually people's awareness of the poor, the password is relatively simple, the user name of the common password login test, to break the password.For learning purposes only, do not use for

Shell Bash determines whether a file or folder exists

Shell Bash determines whether a file or folder exists1, #如果文件夹不存在, create Folders folder="Log"if[!-D"${folder}" ]; Then mkdir ${folder}fi2To determine if a file exists.="/var/www/log.txt"# -The f parameter determines whether the $file

Total Pages: 541 1 .... 473 474 475 476 477 .... 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.