Usage of Shell functions and source commands

The source command can load another script in one script. The following is an example: First, we define a function script named myfunc. Sh, as follows: #! /Bin/bashFunction Square{Local tempLet temp = $1*$1The sum of squares of Echo "$1 is: $ Temp"

Shell decompression script

The case expression can be used to match a given string, not a number (do not confuse switch... case in C ). Case... in...) do something here esac The file command can identify the file type of a given file, for example, file lf.gz. The output

Linux Shell FTP upload and download operations

FTP-I-v-n FTP download, open IP port is the connection server, User Username Password is the login, CD/admin is the CD to the Admin directory under the FTP server, LCD D: /Shell/data is used to change the local working directory to the

When cygwin executes the shell script, a syntax exception occurs. The most basic if control cannot be parsed.

I learned the shell script today and copied a simple script on the Internet as follows: #! /Bin/bashCygwin = true# Assign values to variables:A = "Hello World" # No space exists on both sides of the equal sign# Print the value of variable:If $

Special symbols of Linux Shell

Compare shell strings and determine whether the string is a numberBinary comparison operator, which compares variables or numbers. Note the difference between numbers and strings. ◆ Integer comparison -EQ equals to, for example, if ["$ A"-EQ "$

Rotating the card shell-define the pair point)

Tangent to Vertex Returns a convex polygon.P, TangentLIsPIntersection andPInternalL. This concept is similar to orthogonal tangent. Pair of vertex points If two verticesPAndQ(BelongP) In the two parallel tangent lines, they form a pair of

A simple shell Backdoor

A simple shell Backdoor Author: Pony/smallhorse [e.s. t VIP] (it doesn't matter if you do not write this e.s. t VIP)Source: evil baboons China Recently, I was bored and thought about writing a simple shell backdoor. At the same time, anti-virus

Usage of shell -- tr

TR is used to delete control characters in a file or convert characters.Syntax: TR [-C/D/S/T] [set1] [set2]Set1: Character Set 1Set2: Character Set 2-C: complement. Use set2 to replace characters not included in set1.-D: delete all characters in set1

Object-oriented shell scripts

Do you still remember the regular expression that used to calculate prime numbers? The world of programming is so interesting that you will always be able to see something special. Have you ever thought that you can put your variables and functions

Linux Shell programming knowledge point summary (to be continued)

2011-04-23 wcdj   The method for learning shell program design is: Hands-on + man command The following scripts are all tested in cygwin.$/Bin/Bash -- versionGNU bash, version 2.05b.0 (1)-release (i686-pc-cygwin)Copyright (c) 2002 Free Software

Linux Shell: Test Command Parameter Parsing

Format: Test conditions Test-N string: string is not emptyTest-Z string: string is empty Test int1-EQ int2: int1 = int 2Test int1-ne int2: int1! = Int2Test int1-GT int2: int1> int2Test int1-ge int2: int1> = int2Test int1-lt int2: int1 Test int1-Le

Linux bash shell Learning (9): Process Control -- If/else

This article is the fifth chapter of Flow Control in learning the bash shell 3rd edition, but we will not limit it to this. Flow Control is a common part of any programming language and includes bash. Here we will learn about them. If/else is used

Shell basic notes

Note: No space is allowed between the left and right sides of "=". The semicolon program 1 # is not required at the end of the bash statement #! /Bin/sh # echo somethingecho "Hello World" Echo "Hello !! "CD/root/export topmkdir./ABC Program 2,

Shell Summary of special variables: Location variables $1, $ *, $?

$1 indicates the first parameter. $ * indicates all parameters entered by the user. The hello1 script is as follows. A location parameter is acceptable. #! /Bin/bash Echo $1   Run the Script:./hello1 "Hello World" and output Hello World on the

Shell Summary: Select expressions and for Loops

The Select expression is a bash extension application, especially for interactive use. You can select from a group of different values.Select VaR in...; doBreakDone... Now $ VaR can be used ....The following is an example:#! /Bin/shEcho "What is

Common ADB shell commands and database query methods in Android

The Common commands of ADB shell in Android and the methods for viewing application database information under cmd are as follows: CMD -- ADB shell: Enter the shell command interface of the simulator. Ls displays all the file directories in the

Shell (4) mongo.doc

1) Create FunctionName { ... } Or: Name (){ ... }   2) Call Use the function name directly. The function can be called only after it is defined; When a function has the same name, the new definition will overwrite the old definition and no

Shell (10) commonly used command. Doc

Ls -L, show the hard link count; -I, show I-node -H, human readable -T, sort by modify time -S, sort by size -R, -- reverse -R, show content of sub-Dir -V, sort by version  CP -P,Retain source file attributes, such as the modification time -L,

Shell if else

Example: #! /Bin/sh Mypath = "/var/log/httpd /"Myfile = "/var/log/httpd/access. log" # Here, the-x parameter determines whether $ mypath exists and has executable permissions.If [! -X "$ mypath"]; thenMkdir "$ mypath"Fi # Here, the-D parameter

Write an awk script in the shell script to extract data. Note the format. Use shell variables in the awk, convert the numeric strings in the awk to numbers, and compare the strings in the awk.

In awk programming, do not forget that awk processes regular expressions. There are many internal functions, especially string processing functions. Calling these functions can reduce the workload. 1. Format // Note \ There cannot be spaces behind

Total Pages: 541 1 .... 452 453 454 455 456 .... 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.