Jenkins calls the shell to perform database upgrades and backups

# # #this is deploysql.sh####!/bin/bashLang= "en_US. UTF-8 "Date= ' date + '%y%m%d_%h%m%s 'User=rootPassword=yourpasswordcd/root/sqltest/SVN upIf [$? = 0];thenget_env= ' cat/root/sqltest/upgrade.sql |grep ^ #ENV =|sed ' s/#ENV =//g;s/.$//'Get_host= '

Common statements for Linux shell scripts

Linux shell directives such as-D,-F,-e are judged by :File comparison Operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file

Shell--if, Case Grammar detailed

1. Conditional Select if statementSelect Execute:Single BranchIf judgment condition: ThenBranch code with true conditionFiDual Branchif judgment condition; ThenBranch code with true conditionElseThe condition is a false branch codeFiMulti-Branchif

LINUX_10------Linux Shell programming------variables

Shell programming is designed to simplify management operations。1、base variable and variable classificationbase is the standard shell for Linux。Base VariableSet:querying all environment variables under the systemEnv: view environment variables under

Linux Current Shell Summary!

Task handover, different systems, versions, and shells may not be the same. Some time ago to help a friend to engage in centos5.9, ya ya the use of incredibly is sh. It's crazy! Make a brief summary.View the shell supported by the current

Shell Basic Statement

Shell operators and basic statements1. Operators Operator Describe Example File comparison Operators -e filename True if filename exists [-e/var/log/syslog] -D filename

Shell Script Encryption Notes!

Do you write a shell that is encrypted in the production environment? Anyway, I do not, the online environment to see the Bai, feel nothing. In fact, it seems that there are several benefits.1, simple encryption, to prevent others from looking

Linux Bash Shell Learning Notes

Parameter extension:1. The parameter referenced by the name is called a variable2. Parameters referenced by numbers are called positional parameters3. Parameters referenced by a particular symbol have a special meaning and purpose, and are referred

Linux Foundation--bash Shell Environment configuration

To use a good bash shell, first of all to understand the bash shell environment configuration, only the configuration, we will be handy, to configure, we must understand the type of bash configuration file, and then according to the actual needs to

Function of Shell programming

functions: Function functions are statement blocks consisting of several shell commands for code reuse and modular programming1) Definition of function:Can be defined in the command line, part of the script, only in a separate file of the

Shell Scripting Learning-Grammar Chapter

I. Condition testing: Test [The command test or [can test whether a condition is true, if the test result is real, the exit status of the command is 0, if the test result is false, the exit status of the command is 1 (note the exact opposite of the

Shell Learning Note 2

First, Shell special variables1. Position Variables Positional variables Meaning $ Gets the file name of the currently executing shell script, including the script path $n Gets the nth

Shell script Programming---statement control in Linux

Overview:Statement control for Shell scripts-There are three processes in the process programming language mentioned earlier:Sequential execution: Executed in the order of a single statement;Select execution: Select execution according to the

Simple shell Script Programming example (looping)

For loopFor variable name in list;Loop bodyDoneImplementation mechanism:Assigns the element in the list to the "variable name" in turn; The loop body is executed once each assignment; Until the elements in the list are exhausted, the loop endsList

Positional parameter variables in the Linux shell

To understand positional variables, first you need to know what a variable is.A variable is a particular string that represents something that is not fixed, and simple to understand is to replace another complex or volatile data with a simple "word".

Shell script Programming

Shell script ProgrammingThe history of programming languages: Machine language--Assembly languages--high-level languagesCategories of programming languages:(1) According to the operating modeStatic language: Compiled language, pre-converted to

Conditional testing and looping statements in the shell

condition Test1. Condition testing: Test [The command test or [can test if a condition is true, if the test result is real, the exit status of the command is 0, if the test result is false,The exit status of the command is 1 (note the exact opposite

How to let awk use Shell variables under Linux

How to let awk use Shell variables under LinuxWhen we write shell scripts, we typically include other small programs or commands in the script, such as awk operations. For awk , we need to find some way to pass some values from the shell to the

Shell learns the next day

Condition testThe command test or [can test whether a condition is true, if the test result is real, the exit status of the command is 0, if the test result is false, the exit status of the command is 1 (note the exact opposite of the logical

Shell script, an awk array of how to handle multiple files.

[[Email protected]awk]#seq Ten|Xargs-N2>file[[Email protected]awk]#seq Ten-1 1|Xargs-N2>File1[[email protected]awk]#Cat file1 23 45 67 89 Ten[[Email protected]awk]#Catfile1Ten 98 76 54 32 1[[Email protected]awk]#Cat file|awk '{print $}'13579[[Email

Total Pages: 541 1 .... 292 293 294 295 296 .... 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.