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= '

The first day of Shell learning

Shell Basics Shell's Makeis the command that interprets the user, the user enters a command, and the shell interprets the execution of a rule, which is called Interactive (Interactive),The shell also has a way of executing a command called

Simple progress bar for shell scripts

The basis of a simple progress bar1. ArraysBash supports one-dimensional arrays (which do not support multidimensional arrays) and does not limit the size of arrays. Similar to the C language, the subscript of an array element is numbered starting

Shell learns the third day--grep, SED, awk

GrepIn the past, we used grep to find lines in a file that contained certain strings, such as finding a string in a header file that fits a pattern (pattern), such as finding all strings that conform to the [email protected] pattern (that is, the

Shell Script---syntax chapter

1. Condition test1) test2) [650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/85/99/wKiom1epiarg-HB5AABchcrnS3o789.png-wh_500x0-wm_3 -wmp_4-s_2416745738.png "style=" Float:none; "Title=" Captures 4. PNG "alt=" Wkiom1epiarg-hb5aabchcrns3o789.

Shell variable Day01

VariableDefining variablesYour_name= "Runoob.com" #变量名和等号之间不能有空格Using variablesYour_name= "QINJX"Echo $your _nameEcho ${your_name}echo "I am good at ${skill}script"echo "I am good at ${skillscript}"Curly braces are added to help the interpreter

The Shell's awk little memory

Awk is a powerful text analysis tool, with the search for grep and the editing of SED, which is especially powerful when it comes to analyzing data and generating reports. To put it simply, awk reads the file line-by-row, using spaces as the default

Fundamentals of shell programming for Linux learning articles

Set Environment variables:①export variable name = variable Value #设置环境变量② variable name = variable Value #设置环境变量Export variable NameSet #显示当前shell所有变量Env #查看环境变量unset variable name #删除变量Common environment variables:Path variable: Paths to System

What does the shell variable $0,$ in Linux mean?

The basic meaning of shell variable $#,[email protected],$0,$1,$2 in Linux:Variable Description:$$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return value)$-Flag at a

The shell string operator

${varname:-word}If varname exists and is not nil, returns the value of VarName, otherwise returns word. This is commonly used to return a default value when VarName is undefined${varname:=word}If varname exists and is not nil, return the value of

Hdu2466-shell Pyramid

First preprocess the number of layers and rows, then three answers, pay attention to the details#include #defineINF 0x3f3f3f3fConst intmaxn=2000100; typedef __int64 LL;using namespacestd;inti; LL N,s,ans1,ans2,ans3; LL SUM[MAXN+Ten]; LL

Shell script Batch processing string

Last Friday operations there was a excle for a mobile phone number, asking for information about all users that correspond to user numbers. This time encountered a problem is that you need to query the number of users, not one to check, and excle in

Loop statements in the shell

For syntax formatfor Var in list;doCommandsDoneWhere list can contain:1) write directly for in a b c D; do Echo $alpha Done2) variableslist="a b c d" for in $list; do Echo $alpha DoneThe variable is replaced when the shell executes, and

Path expansion in the shell

Glob extensionIn the path extension in the shell, there are several glob involved:? Match any single character* Match 0 to more characters[Set] matches any one of the characters in the set, such as [0-9], matches any number[!set] matches any

Shell Programming Considerations in Makefile

Reference: http://blog.csdn.net/wanglang3081/article/details/49423105 (1) Makefile is essentially a shell script, that is, each command is a shell process, and the shell process exits when it finishes running. (2) Shell code line, if there is =,

The difference between source/fork/exec in the shell

Tag: exec source ForkFork is a system call to Linux that creates a child process that is a copy of the parent process, obtains a certain resource allocation from the parent process, and inherits the environment of the parent process. The only

Shell Programming--variables

First, define variablesDefine variable names without a $ (unlike PHP, as with Python), with no spaces between variable names and "=" (special, unlike other languages)Example: x= "Hello World"Note: The naming of variable names should follow the

Shell of Linux Basics (1)

The shell acts as an interface between the user and the kernel in the Linux system, which is used to convert the commands entered by the user into instructions that the kernel can understand, and then to perform the corresponding functions through

Shell script Shallow in

The most common Linux commands and toolsDirectory Next document: CD nameReturn to the previous directory: CD.To view and edit a text file:? View files: More, tail? Edit File: VIsuch as scripting. SHVI shell.shTo view system network status:? View

Linux Shell functions

IntroductionBody$?$? is a shell variable that represents the exit state of the last execution command. 0 for success, not 0 for failure. Remember: $? Always indicates the exit state of the shell command after the last execution, and when the

Total Pages: 541 1 .... 359 360 361 362 363 .... 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.