Shell generates a simple format XML instance _linux shell

Here's the shell code:create_xml.sh Copy Code code as follows: #! /bin/bash #author: Dengzhaoqun#date: 201202/14 Outfile=outTabs=0 Put () {Echo ' ' >> $outfile} Put_head () {Put '? ' ${1} '? '} Out_tabs ()

Get two-day-interval shell script code _linux Shell

Copy Code code as follows: #!/bin/sh # Get the first day of the quarter, the date interval to yesterday # link:www.jb51.net # DATE:2013/2/28 Day= ' date-d "1 days Ago" "+%y%m%d";year= ' expr substr ${day} 1 4 ';Month= ' Expr

Extract Oralce-day alert log shell script code _linux Shell

Shell script to extract alert log for Oralce day Copy Code code as follows: #/bin/sh #get Alert of Everyday #then name of file is everyday_alert.sh Dir= "/oracle/admin/bbdz/bdump" num=$ (cat-n ${dir}/alert_bbdz.log | grep "'

Used to record shell scripts that use commands after login _linux shell

Copy Code code as follows: #/bin/bash # History After #把以下代码直接粘贴到/etc/profile user_ip= ' who-u am I 2>/dev/null| awk ' {print $NF} ' |sed-e ' s/[()]//g ' Histdir=/var/log/.hist If [-Z $USER _ip] Then User_ip= ' hostname ' Fi if [!-D

Implementation method of implementing SSH automatic login server and batch management with expect _linux shell

ssh

Shell code: Copy Code code as follows: #!/usr/local/bin/expect Set PASSWD [lindex $argv 1] Set IP [lindex $argv 0] Set CMD [lindex $argv 2] Spawn ssh $IP $CMD Expect "(yes/no)?" { Send "YESR" Expect "Password:" Send "$PASSWDr" } "

Realization method of SSH,SCP automatic landing _linux shell

ssh

Example:A is a local host (that is, a machine used to control other hosts);b is a remote host (that is, a controlled machine server), if IP is 192.168.60.110;Both A and B systems are Linux. To run a command on a:# ssh-keygen-t RSA (three

How to debug a Linux shell script _linux shell

The shell also has a real debug mode. If there are errors in the script "Strangescript", you can debug this: Sh-x Strangescript This executes the script and displays the values of all the variables. The shell also has a pattern that does not

Automatic restart of service shell script code _linux Shell

Copy Code code as follows: #!/bin/bash if [!-f/tmp/down_count];then echo "0" > /tmp/down_count Fi Curl-i tomcat-host-o "/tmp/status" >/dev/null 2>1 Code= ' awk ' nr==1 {print $} '/tmp/status ' If ["$[code]"-ge];then

Linux shell implementations two ways to get user input to a single character in a specified range _linux shell

Method One: Copy Code code as follows: Echo ' echo {a.. Z} ' echo {A.. Z} ' >/tmp/letterfile While Read-p ' please input a letter: ' Letter Todo ((' Awk-v var= "$letter" ' Begin{print length (var)} ' = = 1)) && grep-q

Bulk Modify SSH configuration expect script _linux shell

The first idea, with iptables the external network SSH packet drop off;The second idea, with Tcpwrapper to sshd allow write death;The third idea, revise sshd_config, only listens intranet request. Due to some unclear reasons, the iptables approach

The shell script matches the IP address with the regular expression _linux shell

In the operational dimension scenario, we often need to match the IP address with a regular expression on the server. The shell, like other programming languages, can also use regular group captures, but you cannot capture groupings in the form of $

Shell script realizes real-time detection file change _linux shell

svn

Using Python for Web development, it is now popular to use UWSGI to invoke Python programs, but using UWSGI for a period of time to find that there is a disadvantage is that every time you change the source code must restart Uwsgi to take effect,

Example of positional variable parameters (special characters) in shell script _linux shell

$#: Number of parameters passed to script$*: Displays all parameters passed to the script in a single string. Unlike positional variables, this option argument can exceed 9$$: The current process ID number of the script run$! : The process ID number

Variables in the shell using a summary _linux shell

svn

The definition of a variable can only begin with a letter and an underscore, case-sensitive, and may contain a numeric letter underline. See Official Handbook Copy Code code as follows: [Root@svn shell_example]# yourname= ' Linux ' [

Linux Shell Implementation Daemon Script _linux Shell

Embedded beginners, the first time to upload code. Yesterday did a UDHCPD and Udhcpc Guardian, currently only with Shell imitation writing, what method can do guardian? #! /bin/sh #进程名字可修改 pro_name=udhcpc wlan=ra0 while true; # get

Linux shell script Implementation detects tomcat_linux shell

Linux shell script detects tomcat and restarts automatically Background Run command sh xxx.sh &View background tasks: JobsSummoned to the front desk: FG Jobs number The code that can delete the while loop is put into the crontab, and the script

Shell script Implementation Delete mail queue _linux shell

Recently encountered a problem: The machine mail queue is always stuffed, but do not know where to send mail written, very egg pain, no way, only temporary treatment, wrote a delete mail script rm_mqueue.sh. Copy Code code as follows:

The shell script implements the bulk download resource and retains the original path _linux shell

Sample Resources Listsuch as Url.txt: Copy Code code as follows: Http://su.bdimg.com/static/superplus/img/logo_white_ee663702.png Http://su.bdimg.com/static/superplus/img/logo_white_ee663703.png

Shell script Implementation installs Jdk_linux shell automatically in Linux system

A: This script runs the machine, LinuxB: The machine that installs the JDK, Linux First, on machine A on which the script runs, determine that you can log on to machine B on the JDK by SSH without a password, and then you can run this script on a:

How shell scripts avoid repeated execution _linux shell

Many of the shell scripts executed with Cron may take a long time to execute for a variety of reasons, and it is necessary to check whether they are still running while running. This article provides a Linux shell script to check with the command sh

Total Pages: 541 1 .... 458 459 460 461 462 .... 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.