Shell scripts for database operations

MysqlMysql-h${hostname}-p${port}-u${username}-p${password}-E "SQL statement"-hlocalhost-uroot-proot customer-e "select * FROM Customer "> 1.txtReference article:Http://www.2cto.com/database/201410/343557.htmlShell Programming--eofhttp://blog.163.com/

Nginx under the log cutting shell

#!/bin/bashMkdir-p/data01/nginx_log/$ (Date +%y%m%d)cp/data01/nginx_log/access.log/data01/nginx_log/$ (date +%y%m%d)/access-$ (date +%y%m%d). log#先复制原来的正常访问日志Cat/dev/null

Nginx under the log cutting shell

#!/bin/bashMkdir-p/data01/nginx_log/$ (Date +%y%m%d)cp/data01/nginx_log/access.log/data01/nginx_log/$ (date +%y%m%d)/access-$ (date +%y%m%d). log#先复制原来的正常访问日志Cat/dev/null

shell-Deleting a variable

unset directive: Delete the specified shell variable or function"Syntax" unset [-fv][variable or function name]"Feature description" the directive functions primarily to delete the specified shell variables and functions."Parameter description"

Shell processing command-line options getopts

Getopts is a built-in command of the shell, typically used to handle shell command-line options, but cannot handle long options (such as--prefix=/home, etc.) directly.Getopts has 2 parameters, the first parameter is a string, including the character

Classic Shell 4.2.4 Chinese version has been released

The new version supports the Windows 10 operating system. Please click on the link in the top left corner of this blog page to download.Blogger's computer recently upgraded to the Windows 10 operating system, the use of a few days will not open the "

Shell-Script gives multiple data lists to perform tasks

Method 1:#!/bin/bashuser= ' cat iplist.txt ' pass= ' cat Passwd.txt ' echo $USERSSH () {while Truedo x=$1;shift;y=$2//Note s                                Hift, if the shift operation is not performed, the value of $ $ will not change.

Hbase Shell uses

Hbase Shell DetailsHBase provides users with a very convenient way to use it, which we call "HBase Shell."The HBase shell provides most hbase commands, which can be easily created, deleted, and modified by HBase shell users, as well as adding data

The shell creates the user in bulk and points out the error?

The script comes from----a work unit     #脚本是错误的, and I've corrected it when I work.          work in the time I found a inexplicable script   I think the script writes a lot of errors  ~                                  let's see where the error is

First shell script

Open a text editor, create a new file with the extension sh (sh for Shell), the extension does not affect the execution of the script, see the name of the good idea. #!/bin/bashecho"Hello world! " ""#!" is a contract tag that tells the system what

I wrote an nginx startup script, Shell

Idea: After Nginx starts, there will be a nginx.pid file in the specified location, by judging whether the file exists. Determine if Nginx has been started.#!/bin/bash#this is my first try to test write a shell to control nginx Daemon#History 2015-08

What the shell means

Shell: The shell is the most straightforward way to operate Linux, interacting with the Linux system through the input commands in the shell.The shell is a small box, each with a separate namespace, the login operation is a shell (possibly bash,zsh,

Shell various ways to perform the difference

Shell scripts are executed in various ways (source./*.sh,. The difference between./*.sh,./*.sh)Original source: http://blog.csdn.net/dance_rise/article/details/8573560Conclusion One: The/*.sh is executed in the same way as sh./*.sh or bash./*.sh,

The SED command usage for Shell Scripting Learning notes

The SED command usage for Shell Scripting Learning notesBasic usage of SEDSed:stream EditorLine EditorSED: Pattern space Stores matched text content in pattern spaceBy default, the original file is not edited, only the data in the pattern space is

Regular expressions in the shell

The essence of the shell is to convey a series of commands or signals to the system, usually in the form of a command plus a large string of characters. This string of characters is the character used to express meaning, which is the regular

Shell Learning 19-shell until cycle

The Until loop executes a series of commands until the condition is true. The Until loop and the while loop are just the opposite of the processing mode. The general while loop is better than the until loop, but at some point it is only rare that

Tomcat shell script (Start | off | restart | state)

#!/bin/bash## chkconfig:- the the# Description:tomcat Start/stop/status script#location of Java_home (bin files) export Java_home=/usr/java/jdk1.7. 0_80#add Java binary files to pathexport PATH= $JAVA _home/bin: $PATH #catalina_home is the location

Shell Learning 1-shell Introduction

The shell itself is a program written in C, which is a bridge for users to use Unix/linux, and most of their work is done through the shell. The shell is both a command language and a programming language. As a command language, it interprets and

Java Remote Execution Shell script class

1. Java Remote Execution Shell script class1 Packagecom.test.common.utility;2 3 Importjava.io.IOException;4 ImportJava.io.InputStream;5 Importjava.io.UnsupportedEncodingException;6 ImportJava.nio.charset.Charset;7 8

Difference between reverse quotation marks (') and $ () in Shell

Difference between reverse quotation marks (') and $ () in Shell Echo`Echo\ $ Hostname'//Reverse quotation marksecho $(echo \$HOSTNAME) //$() Someone asked today: Echo 'echo \\\\\\ W' echo $ (echo \\\\\\\ w) Why is

Total Pages: 541 1 .... 426 427 428 429 430 .... 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.