Shell Script ——— Compare integer size classic case

Method 1: Pass the parameter#!/bin/bash############################################################### File Name:compare1.sh# version:v7.4# Author:feng Yu# organization:http://blog.51cto.com/13520761# Created Time:2018-03-26 17:22:20# Description:###

If condition judgment and judgment summary---shell script

This article mainly introduced the shell script if condition judgment and the judgment condition summary, this article first gave the IF condition judgment the grammar, then gave the commonly used judgment condition summary, needs Friend can refer

Shell script Common commands: Expect

Expect:is based onTcla relatively simple language for a free scripting toolused to implement automated and interactive task programs for communication without manual intervention. For example:ssh ftp , and so on, these programs normally need to

Linux Shell Brief Tutorial (i)

Series article starter platform for Jelly want personal blog. Jelly think, is an original technical article sharing site. Here jelly will share his technical experience, technical gains and losses, technical life. I want to wait for you in jelly,

25. Shell special Symbol Cut command, sort_wc_uniq command, Tee_tr_split command,

25, Shell special symbol Cut command, sort_wc_uniq command, tee_tr_split command, Shell special symbol underFirst, shell special symbol Cut commandSpecial symbols*: Wildcard.?: any one character.#: Comment characters, add to command before command

Shell Script Debug Print log issues

Shell Script Debug Print log issue 1. DemandWhen we write scripts, sometimes we need to do debugging, so that we can locate the problem, and sometimes when the script goes online, we need to keep the records during the execution of the script. It

Write a simple shell script

In some complex Linux maintenance work, a lot of repetitive input and operation is not only time-consuming and error-prone, but writing a proper shell script, can be batch processing, automating a series of maintenance tasks, greatly reducing the

Sylixos execution of In-module functions under shell command line

1. Scope of applicationThis document describes the implementation of the function implementation principle in the kernel module in the shell command line.In VxWorks, the system comes with the function of directly executing the driver and in-app

3 ways for the shell to read a file by line

Method 1:while the most efficient and most commonly used method in the loop.While read line DoEcho $lineDone Note: This is done at the end of the file, as if it were done and then read the file in the same way.Method 2: Pipe method: Cat $FILENAME |

Process Control of shell scripts

Process Control of shell scripts Process Control of shell scripts Conditional statements Conditional judgment Loop Statement For,while,until For loop While loop Until cycle

Shell script (Batch create script)

While ;(create a 20 file )Cd/etc/servicesMkdir-p scriptsVim scirpts. Sh#!/bin/bashI= 1, dir=/scirptsWhile [$i-lt 21]Do Touch dir/test$iLet i = $i +1DoneBatch renaming:#!/bin/bashI= 1, dir=/scirptsWhile [$i-lt 21]Do MV dir/test $i alex$iLet i = $i

Shell Monitor lists 10 cpu-intensive processes in 1 hours

The script reads as follows:-------------------------------------------------------------------------------------------------------#!/bin/sh#定义变量secs=3600Unit_time=60stepts=$ (($secs/$unit _time))echo CPU usage ...;For ((i=0;iDoPs-eo COMM,PCPU |

Shell Features: PS1, PS2

[Email protected] ~]# echo $PS 1 # View the main prompt ~]# echo $PS 2 # View from the prompt ~]# export ps1= ' [\[email protected]\h \w]\$ ' # Set the main prompt (temporary), If you want to permanently

Examples of use of the Bash bash shell

************************************************************************* * * * Original:blog.csdn.net/clark_xu Xu Changliang's Column************************************************************************? time to read the file#!/bin/bashFor file

Shell First: BASH Environment

What is a shell?The shell typically represents two levels of meaning, one is the command interpreter, such as bash, and the other is the shell script. In this section we stand on the command interpreter's point of view to illustrate the shellCommand

(Linux shell) Chapter One-small trial sledgehammer (next)

Article Source: (Linux Shell) The first chapter--Small trial sledgehammer (next)1.6 Arrays and associative arrays1.6.1 Preparation KnowledgeBash supports common arrays and associative arrays at the same time. An ordinary array can use integers only

Single quotation mark (') Double quotation mark (") and back quotation mark (·) in the shell

In bash, $, * 、?、 [,], ', ', ', \, have special meanings. Similar to the compiler's pre-compilation process, bash, in the process of scanning the command line, will first interpret all the special characters at the text level, and then make the

Use Crontab to have Linux execute shell scripts at timed intervals

Read Catalogue 1. Cron Service "Ubuntu environment" 2. Crontab usage 3. Edit the Crontab file 4. Process examples 5. Several examples In Linux, periodic tasks are typically handled by the Cron daemon . Cron reads one or more

Use the shell to write a script that has more than 80% mail alerts on the disk

Method 1:Monitoring disk or CPU exceeding a certain value mail alert script:[email protected] scripts]# cat check.sh#!/bin/bashLang=en_us. UTF-8cpuused= ' Top-n 1|awk-f ' [,%]+ ' nr==3 {print100-$11} 'diskused=$ (df-h|awk-f ' [%]+ '/\/$/{print $}

"Turn" console, terminal, Tty,shell and other concepts of the difference

Transferred from: http://www.2cto.com/os/201403/282583.htmlHttp://blog.sina.com.cn/s/blog_bcdac52b0101i2r1.htmlDifferences in concepts such as consoles, terminals, Tty,shell, etc.The use of Linux has been for some time, but it has not been

Total Pages: 541 1 .... 85 86 87 88 89 .... 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.