Introducing Shell Scripts

Simply put, the shell is a file containing several lines of shell or Linux commands. For a large number of commands that are written and used more than once, you can save them using a separate file,For later use. Typically, shell scripts are

shell--record an advanced level of personal script

This script is used in the common shell syntax of the work, the trivial grammar together can help to deal with work, liberation of manpower.The main common shell knowledge points: Determine if the parameters exist and determine the number

Special variables in the shell ($ A, $#, $*, $@, $$, $!, $, $1~ $n)

In the shell, $* and [email protected] respectively represent the following meanings:$ A: The name of the script itself$#: Number of positional parameters$*: All positional parameters will be treated as a string[Email protected]: Each positional

Generate random numbers in the shell

Command Introduction$RANDOM # #一般产生4-5 digitsColumn description[Email protected] shell]# echo $RANDOM9926[Email protected] shell]# echo $RANDOM16517[Email protected] shell]# echo $RANDOM3839[Email protected] shell]# echo $RANDOM58572. Generate

Shell determines whether a file exists

Example The difference between-E and-F is that-F stands for regular files (regular file), and-E represents all types of filesRefer to the following:-e filename true if filename exists-F filename True if filename is a regular file-L filename True

Shell-based if statement

In determining the size of a value in addition to (()) can be used in the form of [] but can not use;, If statementif Judgment statement; ThenCommandFiIf,else statementsif Judgment statement; ThenCommandElseCommandFiIf Elif statementIf Judgment

Jenkin Configuring the Execute Remote shell command

When using Jenkins for integrated deployment, when we deploy the generated war packages, we often need to make some backups or suspend the operation of the server, which can be executed directly in Jenkins.1, first install the plug-in SSH Plugin    2

The Shell of Linux

The shell is the interface that the user interacts with the system, which is one of the basic ways. The standard shell is bash.Shell's Operation: Show all used commands: history. Execute a command that has been recently executed:!!。 The

Shell command Daquan

Shell Command CollectionCCat Zdd Browse the contents of a ZDD fileCat Zdd1 Zdd2 Browsing the contents of multiple filesCat-n ZDD Browse the contents of a file Zdd and display line numbersCD back to the start directory, that is, just logged into the

Shell quotes are useful

1 single quotation marksSingle quotation marks can be used to restore the literal meaning of characters, to implement the function of shielding metacharacters, single quotes must be used in pairs[Email protected]~]# echo ' $JAVA _home 'Special

10th Shell Programming (2) _ Character intercept command

2. character intercept commands2.1 Cut field Fetch command (grep fetch row, cut fetch column )(1) Cut command:#cut [options] File nameOption:-F Column Number: Extract the first few columns;-D delimiter: Splits columns by the specified delimiter,

9th Shell Basics (1) _shell Introduction and script execution methods

1. Shell Overview1.1 Shell Introduction(1) The shell is a command-line interpreter that provides users with an interface system-level program that sends a request to the Linux kernel to run the program, allowing the user to start, suspend, stop, or

Linux Shell Basics (vi)

bz2

12. Sort commands for Rowssort:1. Sort command-line options: Options Describe -T Separators between fields -F Ignore case when sorting based on character -K Define

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

Linux Shell Basics (10)

Twenty. To get the system run data through the pipeline Combination shell command :1. Output the 5 most memory-intensive commands in the current system:#1) Lists all the processes that are running on the current host through the PS command.#2) The

Shell Judgment Statement

1. String judgmentSTR1 = str2 When two strings have the same content, length is trueStr1! = str2 True when string str1 and str2 are not equal-N str1 True when the length of the string is greater than 0 (string non-null)-Z str1 True when the string

Shell Programming (iii)

Bash basic features: command line expansion~: Automatically expands to the user's home directory, or the specified user's home directory;{}: A comma-delimited list of paths can be hosted and can be expanded to multiple paths;For example:/tmp/{a,b}

What does "-e,-d,-f" mean in a shell under Linux?

File expression-e filename true if filename exists-d filename If filename is a directory, true-F filename True if filename is a regular file-L filename True if filename is a symbolic link-r filename If filename is readable, true-W filename if

Shell determines whether a file or folder exists

#!/bin/sh mypath= "/var/log/httpd/" myfile= "/var/log/httpd/access.log" #这里的-x parameter Judging $ Whether the MyPath exists and has enforceable permissions if [!-X ' $myPath]; then mkdir "$myPath" fi #这里的-D parameter to determine if

Peanut Shell Use Tutorial

Inadvertently see the router inside there is a dynamic domain name, and later on-line a check that it is possible to establish a personal website, and then allow other users on the network to access their own servers, such as their own establishment

Total Pages: 541 1 .... 354 355 356 357 358 .... 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.