Automating the deployment of DHCP services with Shell scripting, plus text-to-document verification

The automated DHCP service shell script is as follows:#vim auto_dhcp.sh#!/bin/bashread -p  "please input your ip: "  IP       #设置dhcp服务器ipread  -p  "please input your gw: "  GW       #设置dhcp服务器网关IPNET =$ (echo  $IP  |awk -F.  ' {print $1 '. " $ "." $

Linux Shell Getting Started commands and actions (note)

First, the basic operation1. Important Shortcut keys Tab Complete commands, directories, parameters, filenames, etc. CTRL + C Force the current program to terminate Ctrl+d Keyboard input end

Case Process Control in the shell

Case Flow control:Case structures are used for condition judgments in a variety of situations. Similar to switch/case statements in other programming languages, but it is very different from the grammatical form.Case string inModeStatement;;Mode 2 |

Basic usage of HBase shell

HBase provides a shell terminal to interact with the user. Use the command Hbaseshell to enter the command interface. You can see the Help information for the command by performing a helper. Demonstrate the use of hbase with an example of an online

Shell Monitoring Script 4

#!/bin/sh#count memory_used_rate,disk_used_rate # @yuanwb  2015-5  #disk_used_rate #depend  on real storage place the parameter  ' Location '  need to  Alter. location=/dev/sda1disk_used_rate1=$ (df -h | grep  $Location  | awk  ' {print $5} ') free1=

Shell Operation Memcache

[email protected] mc]# cat mc.sh#!/bin/bashfunction Random {mc0= "192.168.8.62 7510"#MC1 = "192.168.30.22 7510"Case "$ (expr $ (date +%s%n) \% 2)" in0)Mc= "$MC 0";;1)mc= "$MC 1";;Esac}> Set-result.txt> Get-result.txt> Delete-result.txtFor ((i=0;iDoa=

Select usage in the shell

Select is also a kind of loop, it is more suitable for use in the case of user choice.For example, we have one such requirement, after running the script, let the user go to select the number, select 1, run the W command, select the 2 run Top

Shell Script Fork Bomb Learning

:() {:|:&};:Just 13 characters is a bomb, used to look like a simple rote, now also know the point of the fur principle.:() in bash allow: as a function name{} function body:|:&: The function is called first, and then the pipeline calls another new

The shell script function determines whether the IP address entered conforms to the rule

#判断IP是否符合标准规则function  judge_ip () {         #这里local  $1 error, with 2 >/dev/null Shield off error, no effect on the output results         local $1 2>/dev/null         TMP_TXT=/tmp/iptmp.txt         echo $1 > ${tmp_txt}        ipaddr= ' grep  -Eo 

Linux Shell three automatic modification to static IP

This script is mainly used to modify the IP address to static!#!/bin/bash# #Target:  auto chmod ip information! #Date:  2015-05-10#author: jacken# Qq:654001593#qq group:170544180#version: 1.0#only allow define variableshopt -s

Shell multi-process concurrency

Business background: Let a.sh and b.sh execute simultaneously, not sequentially Solution: S.SH is responsible for dispatching a.sh and b.sh. The code is as follows:s.sh#!/bin/bashsource/etc/profile;date= ' 2015-05-06 '

Examples of common applications in shell scripts

1. How can I redirect the standard output and error output to the same location at the same time?There are two ways to achieve this:Method One: 2>&1# Ls/usr/share/doc > Out.file 2>&1The implication is that if a file exists, the result is output to

One of the Shell learning notes (shell built-in commands)

NOTES: # Note: The # in #!/bin/bash at the beginning of the shell file is not a comment run: 1, bash shell.sh 2, chmod +x shell.sh./shell.sh 3, add to Path change Amount of 4,. ./shell.sh Troubleshooting: 1, syntax error when running with prompt 2,

Shell Learning notes seven (looping)

Loops in a loop shell are mainly for,while,untile,select for 1, list for loop for VARIABLE in (list) do Command Done example: Loop print John's favorite fruit for fruit in apple orange banana pear Do echo "$fruit is John's

Shell Learning Notes

#!/bin/bash# Author:undoner# Copyright (c) undoner# Test Code# -----------------------------------------------------------------#标准输入输出echo "What's your name?"Read personecho "Hello,${person}"printf "%d%s\n" 1 "ABC"# ---------------------------------

Linux Series-shell Learning notes

First record1, the simple HelloWorld writingInput command under Shell input:VI helloworld.shThen enter the text editor:#!/bin/shell#this is Ahelloworld testa= "HelloWorld" echo $aExecute helloworld.sh FileCommand:# sh helloworld.sh2, the variable

Shell changes file or directory names in bulk

To change file names in bulk:1. Add. bak or other regular characters after multiple filesLS |xargs-n1-i{} mv {} {}.bakOrFind./*.txt-exec mv {} {}_bak \;2. General-Purpose Batch change scripts#!/bin/bashread -p  "old extension:"  oldextread  -p  "new 

Learn about the--bash Shell summary of Linux with the bird brother

Bash is a Linux-based shell, and many of the commands described in the front are handled by Bash's environment. Here's a general-to-local understanding of bash. For bash I've roughly divided it into three parts: variables, the configuration of the

Sorting algorithm Big Collection _ Insert Class--Hill (shell) sort

The feature of this series of blogs is--give the results of each orderOriginally wanted to write a good process, get a picture of what, but think online analysis too much, are better, so these blog even if it is a summary of their own it.#include

Shell script Learning

Shell script Learning Shell script Learning Shell is a command parser that converts user-input commands into programs that can be run on the corresponding machine. Shell is a program used as an interface between the user and the linux system. It

Total Pages: 541 1 .... 229 230 231 232 233 .... 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.