Several parameters of the shell script

The execution name of this program$n the nth parameter value of this program, n=1..9$* all parameters of this program, this option can have more than 9 parameters.$# the number of parameters for this program$$ the PID of this program (the current

Shell Getting Started-variables

Shell variables are divided into system variables and user-defined variablescommands to view variables#env System VariablesOr #set include env and custom variables and extra variablesThe command to use the variable is#echo $ "Variable"///////////////

Save the shell command as a variable

The command is placed in the "(General keyboard 1 to the left of the key), such asEcho ' DMESG | grep ETH ' The command is placed in $ (), such asecho $ (DMESG | grep eth) Can be saved to the variable varname as followsVarname= ' DMESG | grep

Shell Redirection File Descriptor

#!/bin/bashRecently looking at the shell, a variety of puzzles, but to solve the feeling of confusion is still very good. Needless to say, Linux uses file descriptors to identify each file object. The file descriptor is a non-negative integer that

Traverse the file and format the output file (Shell script implementation)

Background1. In project development, it is urgent to generate files in the following three formats according to the files under the resource path Res.Format one:#define IDR_CEF_0001 101#define IDR_CEF_0002 102...#define IDR_CEF_0122

Shell Line Script

Each time on-line, first put the intranet code with Xhell to local. Then drag it to the online server.Dragged and dragged, too slow. So I wrote an online script.Wrote a few versions, this is the final versionscp_v3.shThe contents are as

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

Shell Multi-file Content Association match

Remove the first two columns from the a file and match the other file to print out the matching line from=$1compare=$2tofile=$3f1s= ($ (cat $from |awk-f ' \ t ' "{print $")) f2s= ($ (Cat $from |aw   K-f ' \ t ' {print $} ') #for i in ' seq 0 ${#f1s [

The Shell gets the Linux server's MAC (generic, does not depend on the NIC name)

Sometimes the server vendors will make their own naming rules, such as some of Dell's server network card name may be the beginning of EM, such as EM1, and sometimes the beginning of the ETH, such as eth0, which let us get the network card command

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

Shell learning: Calling between scripts

For Java,python, you can use the import method to make calls between scripts or modules, for example:>>> Import math>>> math.sqrt (4) 2.0how to invoke other shell scripts in the shell. Or a variable in another script, what about the function?method

The Shell Three Musketeers grep

Objective How did grep get out?It's going to take us discovering, "g/re/p" see, that's it. "Global Regular expression print" ==> "globally finds the regular expression (RE) and prints the resulting row. ”The grep family consists of commands

Shell command (ii) The art of Rsync

(1) rsync (remote synchronize) is a data synchronization tool that allows you to quickly sync files between multiple hosts via Lan/wan, or use rsync to synchronize different directories on your local hard drive. (2) Rsync is a tool for replacing

Shell control Flow Structure notes

Man test can see these  Comparison symbol:-lt less than-le less than or equal to-gt greater than-ge greater than or equal to-ne does not equal-eq equals Greater than (requires double brackets), such as: (("$a" > "$b") >= greater than or equal

Log cut Backup (test) shell script

#!/bin/bashcd= ' df-l |awk ' nr==3 {print $4} ' |awk ' BEGIN {fieldwidths= ' 2 1 "} ' {print '} 'If [$CD-ge 20];thenecho " hard disk space is full and cannot be backed up " | Mutt-s " backup alarm, please replace the hard drive in time " [Email

Log cut Backup (test) shell script

#!/bin/bashcd= ' df-l |awk ' nr==3 {print $4} ' |awk ' BEGIN {fieldwidths= ' 2 1 "} ' {print '} 'If [$CD-ge 20];thenecho " hard disk space is full and cannot be backed up " | Mutt-s " backup alarm, please replace the hard drive in time " [Email

Shell Daily Case (i)

 Orderdeveloped under the Linux platform, we are often exposed to tasks of the nature of the work, and the processing methods are diversified. Now accumulate each case. Cleaning up the data log files for nearly 7 days is getting bigger, and we need

Shell Basics Exercises Explained

1037774765 cloning1. Create a user redhat with an ID number of 1001, a basic group like (Group ID 2002), and rent it near Linux.Groupadd-g 2002 LikeGroupadd LinuxUseradd-u 1001-g 2002-g Linux Redhat2. Create a user fedora with the note information

The Linux Shell Array uses

Ubuntu12.04 TLS 64bit, bash 4.2.25First, the definitionAn array is a collection of some data, divided into two types(1) ordinary arrays, only integers can be used as indexes(2) Associative array , can use string as index, Bash 4.0 start support,

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

Total Pages: 541 1 .... 419 420 421 422 423 .... 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.