Linux Shell Script Raiders (1.12)

1.12 Functions and Parameters Like other scripting languages, Bash also supports functions and can pass parameters. 1.12.1 function definition and parameter transfer#!/bin/bash function fname () #也可以用fname () instead of {echo $1 , $

Beginner Linux--shell

ShellThe shell is a weakly typed programming language.Distinction between strong and weak:Strong: Variables must be declared prior to use, and even require initialWeak: Variables are declared when they are used, even the part is differentiated by

Special variables in the shell

Special variables:      $#the number of arguments passed to the script;       $*displays all parameters passed to the script in a single string. Unlike positional variables, this option can have more than 9 parameters;      $$the current process

Getting Started with Shell scripting

1. Check the current system who is logged in: Who2. Count the logged-in users of the current system: who | Wc-l (L-->line,w-->word,c-->character)3. Small shell script development cycle: $cat > Nusere new file, using Cat copy terminal inputW.H.O. |

Shell command-line statements

The first step:SSH Password-free login "with public key, private key"Step Two:#!/bin/bash while read server; Do "[email protected]" 2 >& 1 "s/^/$ Server:/" &donewait./bunsan2.sh Free Note: While read server considers the input as a

Shell script log cleanup and compression

1, log structure/opt/online/{123com,abccom}/log/online[1-9]/[a-z]2, variable description # Whether to turn on the compression function (0: OFF, 1: on; If the compression function is turned off, the Compressdayn is not valid) Needcompress=1 Delete 14

Shell Scripting Learning

1. CommentsIf you use bash, then in the script file header comment: #/bin/bash2, the script file with the Read and execute permissions, you can use the./shell.sh to execute, you can also use the SH shell.sh way to execute directly, SH is the soft

Shell position Variable

When we are learning some frameworks, we usually invoke a script when we start the framework, and pass some parameters to the script, and the script will do different things depending on the parameters we pass, and the parameters we pass are the

Two shell programs that operate ISO files under Linux

Remember this is the original play Cdlinux when, originally should be because of windows under the UltraISO to Cdlinux mirror changes cause the image can not boot, so use the command under Linux to operateThis should be the command to mount the ISO

Shell programming under Linux--startup script for the standard daemon

a standard daemon startup script:#! /bin/shwhoami= ' WhoAmI ' pid= ' ps-u $WHOAMI | Gerp Mydaemond | awk ' {print $ ' if (test "=") Thenecho "Mydaemond [Start][stop][version]" Exit 0fiif (Test "=" status ") thenif (test "$PID" = "") Thenecho "not

Shell script Operators

1. ValueFormat:Test "NUM1" OPR "num2"["Num1" OPR "num2"]OPR Value:Equality:-EQUnequal:-neGreater than:-GTLess than:-lt "L is the lowercase letter L"Less than equals:-leGreater than or equal to:-ge2. StringFormat:[Str1 OPR str2][OPR str]OPR

Clustershell Bulk execution of shell commands

Installing ClustershellInstall from https://github.com/cea-hpc/clustershell/downloads below source or binary package. The following is an example of CentOS6.6 using RPM installation: wget

Linux Shell Common Command Manual (Updating)

Check if the remote port is open for bash: NC-nvv $IP $PORTtelnet $IP $PORT Front and back switch for current task: Ctrl + ZFG The first 5 characters of the Intercept variable: ${variable:0:5} SSH Debug

Regular expressions in the shell

Regular expressions in the shellVbird said that learning Linux, mastering the shell and the regular is equivalent to open the two-channel, after the ability of the growth will be rapid.The Shell's basic learning has been summed up in a blog post:

Shell programming shell script default variables ($, $ ...)

Default variable for Shell script ($ ...)We know that directives can have options and parameters, such as Ls-la to see all properties and permissions that contain hidden files. So can shell script have parameters behind the script file name? It's

"Shell" sed command

Sed is a good file processing tool, itself is a pipe command, mainly in the behavior of the unit processing, you can replace the data rows, delete, add, select and other specific work, the following first understand the use of SEDThe SED command

Linux learning-advanced shell script programming (2) first recognized by sed, gawk, and sedgawk

Linux learning-advanced shell script programming (2) first recognized by sed, gawk, and sedgawk Citation: Sometimes we need to automatically process text in text files without pulling out a fully armed interactive text editor. In this case, it is

Linux learning-advanced shell script programming (I) Functions and shell script Programming

Linux learning-advanced shell script programming (I) Functions and shell script Programming Citation:When writing shell scripts, you will find that the same code or functions are used in many places. It doesn't matter if it's a small piece of code.

Shell-based variables

Shell-based variablesVariable typeShell variables include environment variables, location variables, pre-defined variables, and custom variables.Environment VariableShell environment variables are a type of Shell predefined variables used to set the

Several methods of shell script execution

Several methods of shell script executionYou can execute shell scripts in the following ways: 1. The relative path method must be cd to the script path first. [Root @ banking tmp] # cd/tmp [root @ banking tmp] #./ceshi. sh script executed

Total Pages: 541 1 .... 381 382 383 384 385 .... 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.