About the role and writing of shell scripts, and the general use of the VI editor for editing help

In Linux, the execution of a script can help us save a lot of time, for the execution of the script it is understood by the individual, it is the same as the beginning of the file #! Bin/bash through the VI editor to create a new executable file,

Linux Shell String Common operations

Take the length of the variable [[Email protected] scripts]# var=oldboy123[[email protected] scripts]# echo  ${var}oldboy123[[email protected] scripts]# echo ${#var}9# For example: #以下判断用read输入一个值, if the length is 0, The value is empty,

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

Use shell scripts to detect realserver status in LVS and implement automatic removal of attached hosts

#!/bin/sh# Describe:check the real server status# history:2015-08-25 22:21:38# Author:timPath=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binExport PATHvip=192.168.1.121dip=192.168.1.112rip= ("192.168.1.122" "192.168.1.123")Vport=8

Emptying files with shell scripts

Emptying files with shell scriptsIn recent projects, a lot of log files are generated, so you need to write a script to empty them manually, here are a few typical ways.Method 1 Code#!/bin/bash##方法1echo "" > $1echo "$1 cleaned up."RunDescriptionI

function calls in the shell of the Linux shell

Talk about the function call, I believe that everyone will not be unfamiliar, but for the beginner shell of me, Shell function call Way is a bit let me not very accustomed to, I also go a lot of detours, because the transfer of parameters when a

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"

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

The Helloword of the shell

The Helloword of the shellCd/binLs-l | Find-name SHLs-l | FIND-NAMD BashLs-l | Grep-r sh sh is actually pointing to dashlrwxrwxrwx 1 root root 4 2014-12-11 03:13 sh, dashLs-l | Grep-r BashCD ~mkdir ShellVI hello.sh#!/bin/bash//fixed notation,

Shell Parameters Hollow Lattice

When using the shell to pass parameters.Do not use shift when parsing parametersAction= "$" case "$action" in status) shift [email protected] exit $?    ;; .. *) help exit-1;; EsacBecause even if there are double quotes, it cannot be passed

Shell Common Signal

SIGHUP: This signal is generated to the control process when the terminal disconnects. 1Sigint:ctrl-c or delete is pressed, generated by the terminal driver and sent to all processes in the foreground process group. 2SIGKILL: Causes the program to

Shell-nginx Startup scripts

########################################################################## file name: nginx.sh#  Author: dty# mail: [email protected]# Created Time: Sun 09  aug 2015 06:02:17 pm cst################################################################## ##

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

Calculations in the shell

Numerical calculation of variables in shell common commands(()), let, expr, BC, $[]One, (())Example:[[Email Protected]hell ~]# echo $ ((1+2)) 3Second, letExample:[[email protected] ~]# let a=1+2 [[email protected] ~]# echo $a 3Third,

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

Talking about "Shell" (i.)

Shell, that is, the hard skin, when the thickness of the shell and its surface rate radius of less than 0.5, known as the "thin shell", the reverse is called "thick shell." Chest armor evolved from shells, shields.In a world of computers that is

Environment variable configuration file for Shell programming,

Environment variable configuration file for Shell programming, I. Introduction1. Variable type:User-Defined variables (local variables)Environment variables: Define the operation environment for each user. The learned paths and ps1 are used. To

Total Pages: 541 1 .... 480 481 482 483 484 .... 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.