Shell script Remote Batch execution command

#! /usr/bin/expectset ip 10.91.96.                  ######    Network Segment Set time 30set username  root#### #for  {set ip 11} {$ip > /etc/login.defs\r "send " echo PASS_MIN_DAYS  5 >> /etc/login.defs\r "send " echo pass_warn_age 7 >> /etc/ Login.

Shell scripts determine if a leap year

#! /bin/bashecho-n Input year to judge if it was a leap year:read yearlet "y1= $year% 4" let "y2= $year%" let "y3= $year% 4 XX "If [! "$y 1"-eq 0]thenleap=0elif [! "$y 2"-eq 0]thenleap=1elif ["$y 3"-eq 0]thenleap=1elseleap=0fiif ["$leap"-eq

Shell Script Practice Purge Log

In the production environment log is the operation and maintenance personnel to understand and analyze the production environment first-hand information, but the content of the log information is quite large, especially in the public cloud

Common commands under the shell

1.HELP displays a list of all built-in commands, or the use of a built-in command #help//View all built-in commands #help built-in commands//view built-in command usage #help-S built-in command//display the syntax format of the

Shell Script Example

#!/bin/bash######################################################## Name:shell_exp.sh# version:v21.0# function:backup MySQL Databases Template Script# Author:zz# Create Date:2016-12-03# Description:study###############################################

Compare digital subtraction based on shell scripts no BC

The following methods can not install the BC calculatorCreate sh fileCheck------------------------------------------------------------------v#!/bin/Bashread-P"Please enter the first number"Aread-P"Please enter a second number"Becho"and the"' Expr $a

Linux Shell Text filtering

Regular Expression - concept: A special syntax for describing text patterns -by ordinary characters (e.g., characters A to Z), and special characters (metacharacters, such as/ *?). And so on) make up a matching string--the text Filter tool supports

Linux Shell Basics

Shell is the core program kernel outside the instruction parser, is a program, colleague is a command language and programming language--shell is a command parser, the user Input command, it to parse.Shell type ash,bash,ksh,csh,tcsh--cat

Use of expr in the Shell

The 1.expr command is generally used for integer values in the general format:Expr argument operator argumentThe general usage is to do arithmetic operations using expr, such as:[[email protected] ~]# Expr 10 + 2030$expr 30/3/25(Note that operators

Operator of Shell programming

Declare declaring variable type declare [+/-] [option] Variable name-: Set the type attribute to the variable +: cancels the Type property of the variable-A: Declaring variables as arrays-I: declaring variables as integers-x: Declaring a variable as

Shell gets the current path

Prg= "$"while do ls= ' ls-ld ' $PRG "' link= ' expr ' $ls": ' .*-> \ (. *\) $ ' ` if expr "$link": '/.* ' >/dev/null; then PRG= "$link" else C15/>PRG= ' dirname ' $PRG '/' $link ' fidoneprgdir= ' dirname ' $PRG '-Z ' $CATALINA _home "] &&

Memory monitoring and alarm shell scripts

# free-m |awk ' nr==3 {print $NF} '4012#!/bin/bash Scriptused_mem= ' free-m |awk ' nr==3 {print$nf} 'If [$used _mem-lt 5000]Thenecho "Mem is not enough, $used _mem."echo "Mem is not enough, $used _mem." | Mail-s "MEM Warning $ (data +%f)" [email

Get Script Path in Shell

#!/usr/bin/bashdir_old=$ (PWD)absolute_script_path=$ (CD $ (dirname $) && pwd)relative_script_path=$ (dirname)Wrong_absolute_script_path= $dir _old/$relative _script_pathecho "Current PATH: $dir _old"echo "Absolute_script_path is: $absolute

HBase Shell Basic Command Summary

Accessing HBase, and manipulating hbase, commands do not use semicolonsHBase Shell enters HBaseList View TableHBase shell-dHBase (main):024:0> scan '. META. '============= Small Example ===================================================1. Create a

Linux Learning Diary-shell scripts and Scheduled Tasks

This article will aim to implement regular automatic backups of the MySQL database, and introduce the perfect collaborative process between shell scripts and scheduled tasks. Where the shell script is responsible for the specific backup operation,

Duplicate files with the same deleted contents as shell scripts

#!/bin/bash#! Delete duplicate files with identical contentsLs-ls--time-style=long-iso | awk ' begin{Getline;getline;Name1=$8;size=$5}{name2=$8;if (size==$5){"Md5sum" name1 | getline;csum1=$1;"Md5sum" name2 | getline;csum2=$2;if (csum1==csum2){Print

I have encountered a summary of the shell trivia points

1) Use of shell ifDetermine if a.txt existsIf [-F a.txt]2) Execution result of the commandAssign the execution result of the command to the variable, the following two methods are the sametime=$ (date +%y%m) time= ' date + $Y%m '3) Find out what we

Viewing and deleting variables in the shell

Tag: set command; unset commandFor example: There are now two user-defined variablesName= "Andy Lau"Age=20The set command is used to view variables650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/87/EF/wKioL1fkk0CQqSUwAADT1GLzRuI190.png-wh_

Shell Script Planning Templates

Shell Script Planning TemplatesIn Linux operations, shell scripts are indispensable tools, but each operator programming habits are different, many times is to implement a function, written out of the script is rotten seven or eight bad.Scripts must

Shell Programming-Initial

Programming languages are generally divided into static languages and dynamic languages.Static language: Compiled language strongly typed (variable) pre-compiledExample: C C + + Java C #Dynamic language: Interpreted language weak type (default

Total Pages: 541 1 .... 379 380 381 382 383 .... 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.