The shell script implements the arithmetic operation and the input cannot be a number that is not a number

#!/bin/BashEcho "Please enter the first number"read aEcho "Please enter a second output"Read Bif[[${b}! = *[!0]*]] && [[${a}! = *[!0123456789]* ]]; ThenEcho "Divisor is 0!!!!!!!!!!!!!!!!! "Echo "and for"`Echo$ ((${a} +${b})) `Echo "difference

Log Analysis _ use Shell full log analysis case

First, demand analysis1. Log files are generated each day (the log files need to be uploaded to HDFs) 2. Analyze the fields included in the log file: Access IP, access time, access URL, access status, access traffic3. There are now "yesterday" log

Shell scripts to monitor CPU, memory, and hard disk utilization

#!/bin/bash#createdate: 2016-11-15Date= ' date+%f ' "%h:%m"ip= ' Ifconfigeth0 | awk '/inet addr/{print $} ' | Cut-d:-f2`Echo-e "\033[032mdate: $Date \nhost: $IP \n\033[0m"echo-----------------CPU----------------Cpu_us= ' Vmstat|awk ' {print $13} '

Simple difference between single quotes, double quotes, and unquoted in a Linux shell

Brief summary:Single quotes:What you can say is what you see is what you get: the contents of a single quotation mark are output as is, or what you see in single quotes is what you output.Double quotes:Output the contents of double quotation marks,

Shell Note 7

The result of the test is 0 or not 0, 0 is true, and not 0 means false. Test commandTypically used with statements such as if, while, until, and so on.#test An expression#test [expression]//[trailing space,] preceded by a space File properties

Help Desk Meet Power Shell

Help Desk Meet Power Shell2015-12-14 16:58 Microsoft China TechNet Read 397Share with you some of the views of desktop support and power shell.Desktop technology Support, at first more mechanically repetitive single operations, such as the

Automate the release of Jenkins at specified times by shell+atd scheduled tasks

Our company is through the Git+jenkins+shell+docker to achieve automated update release.Here I say how I use the SHELL+ATD service, at 21:00 in the evening to complete the lead account of a project on-line operation. Note that this on-line project

Linux Shell loop control characters and functions

loop control and functionsBreak loop control, continue loop control.Loop control characterThe break loop control can be used to exit the entire loop;After exiting the loop, the following loops are executed, using the Continue loop

Execution of shell scripts and files

1. Shell Script ProgramThe shell is the "shell" of the operating system, and the shell provides users with a human-computer interface. All the user's actions on the computer and the data that the computer obtains are managed by the shell.Shell

2 PowerShell and CMD and Unix/linux Shell

The previous article, I said, windows in order to change the user to its console interface, and then start from Windows Vista, plan to change this situation, so there isThe advent of PowerShell.1. Compatible Shell commandsTo be compatible with

Basics of 1-22-shell Scripts

1.1 Shell Script Writing specification 1.2 Variable and special variable application 1.3 Local variables and global variables 1.4 Test-piece expression ------------------------------------------------------ Background: In some complex Linux

Shell determines file type and permissions

The shell determines the file type.-D file to determine whether the file exists, and whether it is a directory (the directory is true)-e file to determine whether the file exists (exists as true)-F file to determine whether the file exists , and

Introduction to the basic shell

Shell scripting is one of the skills that Linux OPS engineers have to master, and the use of shell scripts allows us to better operate Linux systems and facilitate our execution.One, the basics of programmingBASIC Programming ConceptsProgramming

Getting Started with shell scripts-symbol Chapter

I. Shell INTRODUCTIONThe role of the shell is to explain the execution of the user's command, the user enters a command, the shell executes one, which is called Interactive, the shell has a way to execute the command is batch processing, the user

Shell Programming notes (1)

Shell Programming:Compilers, interpretersProgramming languages: Machine language, assembly language, advanced languagesStatic language: Compiled languageStrongly typed (variable)Convert into executable format in advanceC, C + +, JAVA, C #Dynamic

Shell Basics: Variable Types & Operators

Shell variable shell supports three types of variables User-defined variables: User-defined variables, variable names begin with an English letter or underscore, and are case-sensitive. Positional variables: Variables that are passed to

A collection of shell backup scripts under Linux

A collection of shell backup scripts under LinuxWhen it comes to the shell we are not unfamiliar, the shell is Linux under the batch script, like the VBS script under Windows and so on, can help us to complete some automated tasks, we also

Linux command Line – First knowledge of Linux shell

Introduction to Shells and scripts The Gnu/linux Shell is an interactive tool that provides users with the means to start programs, manage files on file systems, and manage processes running on Linux systems. At the heart of the

Shell finds the maximum value in an array element

Tag: Shell finds the maximum value in an array elementHow does the shell compare the maximum values in all the elements in an array? Such as:array= (111 222 333 444 555 999 888 777 666) How to find the biggest element 999?Idea: Set a value

Shell Practice-sort Sort by detailed

There is a log file on the server Guest.log, each line contains: ID number, name, Internet café Name, the most recent Internet time, Internet hours, the amount of consumption, now requires the file of each row of the sixth column and the second

Total Pages: 541 1 .... 144 145 146 147 148 .... 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.