Shell script programming judgment Statement _linux Shell

One, single branch if statement Format: if judge condition; then Statement1 statement2 ... Fi Two, two-branched if statement Format: if judgment condition; Then Statement1 statement2 ... else statementn ... Fi Use a

Linux implementation of FTP automatic backup shell script _linux Shell

Use here documentation Copy Code code as follows: #!/bin/sh FTP-IVN 210.29.28.124 User Yun yun2011 Lcd/home/veyun Cd/home/veyun/yhb Get V Bye Eof Explain: -I: Turns off interactive prompts during multiple file transfers, so

VPS Automatic Backup Database to FTP script code _linux Shell

vps

1 Ensure that you are in the home directory (if not, run: cd/home)2 New Backup folder (command: mkdir backup)3) New Script backup.shVI backup.sh Copy the following code (after replication: wq! to save): Copy Code code as follows: #!/bin/

Shell string comparison to determine whether a digital _linux shell

Binary comparison operator, comparing variables or comparing numbers. Note the difference between numbers and strings. Integer Comparisons -eq equals, such as: if ["$a"-eq "$b"] -ne is not equal to, such as: if ["$a"-ne "$b"] -GT is greater than,

Shell command execution sequence analysis [figure]_linux Shell

Each line that the Shell reads from standard input or script is called a pipe (pipeline); it contains one or more commands (commands) that are separated by one or more pipe characters (|). In fact, there are many special symbols that can be used to

Code that determines whether a process exists in the Linux shell _linux Shell

1 matching names with Pgrep Copy Code code as follows: if test $ (pgrep-f $ | wc-l)-EQ 0 Then echo "process does not exist" Else echo "Existence process" Fi The following are supplementary content:Processes in the

Backup shell script instance code _linux shell

1, backup_run.sh Copy Code code as follows: #!/bin/sh # Backup_run # script to run the backups # loads in a setting file for the ' user to ' change Source=/home/bob/backup.defaults Check_source () { # Check_source # Can we load

A shell script _linux shell with statistical CPU memory hard disk usage

Copy Code code as follows: #!/bin/bash #This the script is Usage for describle CPU Hard memery Utilization Total=0 Idle=0 System=0 User=0 Nice=0 Mem=0 Vmexec=/usr/bin/vmstat Which SAR >/dev/null 2>&1 If [$?-ne 0] Then Ver= '

Send log collation number via SMS shell script _linux Shell

Copy Code code as follows: #!/bin/bash #telno for the query number list file #sendsms. Log send result file for SMS #1 Rep sent successfully Query_sms () { >submit_telno >delivered_telno >fail_delivered_telno Cat Telno |while Read line

Find shell script code with the same name but different suffix file names in the directory _linux shell

Because the backstage input colleague, uploads the file the time, to file the same name, but different suffix name, because the file path is very deep, about 10 layers, each layer has dozens of files, so manually find a very troublesome, so write a

Two-segment shell script that counts network card traffic (using ifconfig) _linux shell

Use shell script to compute the Linux NIC traffic, the most critical point in the method: Copy Code code as follows: Ifconfig $eth _name | grep bytes | awk ' {print $} ' | Awk-f: ' {print $} ' The flow of input and output is

The shell code _linux shell for the replacement of IP in Ubuntu and CentOS

Code AUbuntu and CentOS Copy Code code as follows: Ubuntu: #!/bin/bash echo "IPADDR:" Read Line Echo $line Sed "s/address.*$/address=${line}/g"/etc/network/interfaces CentOS (not tested): #!/bin/bash echo "IPADDR:"

Linux Server Security Hardening shell script code _linux Shell

Copy Code code as follows: #!/bin/sh # Desc:setup Linux system security # AUTHOR:CORALZD # Powered by www.freebsdsystem.org # version 0.1.2 written by 2011.05.03 #account Setup Passwd-l XFS Passwd-l News Passwd-l NSCD Passwd-l Dbus

SVN-based Code submission statistics tool implemented by shell script _linux Shell

svn

Nothing recently, I wrote a code statistics gadget based on SVN in bash. You can specify a catalog of statistics, and the default recursive statistics subdirectory. Currently, there is no capability to mask the specified directory. The code is

6 ways to determine if a string is a number in the shell share the _linux shell

This article mainly introduces the "shell judge string is a number", mainly related to the shell to determine whether the string is a digital content, for the shell to determine whether the number of figures interested students can refer to. #!

Shell scripts periodically empty log files larger than 1G _linux shell

A question about how to automatically delete a specified file after it is larger than 1GB.The batch code is as follows: Copy Code code as follows: #!/bin/bash # when the/var/log/syslog is greater than 1GB # automatically back it up and

function return value exceeds problem in shell _linux shell

1. Preface Almost six months did not write a blog, deserted for a long time, the work of the chores too much, their own more and more lazy. In order to spur their own growth, or adhere to write a blog, record their growth. 2. Introduction to Shell

Shell Implementation Force free memory script share _linux Shell

The company server has been dying for the last two days because of the full memory usage. Really can't stand the old call room to help people to restart, specifically wrote a script to release the memory, of course, this server is not too important,

Shell script Implementation installs Zookeeper_linux shell automatically

A: This script runs the machine, the Linux RHEL6B,c,d,... : To be installed zookeeper cluster machine, Linux RHEL6 First, on the machine A that runs the script, determine if SSH can be logged in without a password to the machine b,c,d to install ZK,

Get shell script share _linux Shell in directory of the shell script itself

A few days ago wrote seven bull demo, with Bash wrote a convenient installation of the script, involving the path-related judgments, from StackOverflow, plus their own practice to tidy up. Simple version The following is one of the simplest

Total Pages: 541 1 .... 288 289 290 291 292 .... 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.