Beginner Linux--shell

ShellThe shell is a weakly typed programming language.Distinction between strong and weak:Strong: Variables must be declared prior to use, and even require initialWeak: Variables are declared when they are used, even the part is differentiated by

Shell <<eof

1, consider the following requirements, in the main shell execution command, enter the other command, the input after, want to as the input of the command, instead of the main shell input, how to do?2, use 3. The EOF here is just a delimiter and can

Linux Shell Script Raiders (1.4)

1.4adding environment variables using functions1.4.1Introductionenvironment variables are typically used to store path lists, which are used to search for executables, library files, and so on. For example:$PATH,$ld_library_path, and they usually

Shell command-line statements

The first step:SSH Password-free login "with public key, private key"Step Two:#!/bin/bash while read server; Do "[email protected]" 2 >& 1 "s/^/$ Server:/" &donewait./bunsan2.sh Free Note: While read server considers the input as a

Shell Scripting Learning

1. CommentsIf you use bash, then in the script file header comment: #/bin/bash2, the script file with the Read and execute permissions, you can use the./shell.sh to execute, you can also use the SH shell.sh way to execute directly, SH is the soft

Shell analyzes which programs are occupied by the swap partition (stress simulation environment)

1. View versionCat/etc/debian_version7.82, look at the memory (my side is 256MB memory swap divided by 4G)Free-mTotal used free shared buffers CachedMEM:231 124 106 0 8 79-/+ buffers/cache:36 194swap:3814 0 38143. Using stress to simulate the

A shell script that you wrote to patrol the Linux process

#/bin/Bashhint () {Read-P"Press Enter Tocontiune:"}check_a () {PS-ef |grepCxiang|awk '{for (i=1;i'Text1//use grep and awk to filter the process into Text1. sed '/^.*/s///g'Text1 >text3//delete Text1 in front of empty row in Text3grep-VWF Text3 Text2/

Shell Script intercept Date processing

[Author]: KwuDate formatting fixed to 8 bits in Linux: 2015-01-01String processing required for implementation in 2015-1-1#!/bin/sh# upload logs to hdfsyesterday2= "2015-01-08" Echo ${yesterday2}first=${yesterday2:5:1}second=${yesterday2 : 8:1}echo $

Shell Scripting Exercise 004

1.#!/bin/bashfor IP in 133 134 doname_8808= ' Nmap-p 8808,15080 172.16.1. $ip |sed-n "5" P|awk ' {print $} ' name_15080= '   Nmap-p 8808,15080 172.16.1. $ip |sed-n "6" P|awk ' {print $} ' if [$name _8808 = open-a $name _15080 = open] Then echo

Linux Shell string Cutting built-in method

$MYSTR ="node=slave-01:2.05:1.25:1.00"$ time tmp=${mystr%%:*}; echo ${tmp##*=}real 0m0.000suser 0m0.000ssys 0m0.000sslave-${string#*pattern} minimizes matching pattern from the left and deletes (starting from the left) the first pattern

Linux-shell the size of the judgment

Combat 1: Enter 2 integers to determine the sizeThree ways to achieve:1 defining a variable 2 script parameter 3 read read-inThe first step, give the user prompt, let it enter an integerThe second step is to determine that the first value and the

Shell Scripting Exercise 001

1. Practice Yourself#!/bin/basha=0while:d o a= ' expr $a + 1 ' if [$a-lt 4]then echo-n-E "input number 1 to 9 \ n" read Num case $Num in 1|2|3|4|5|6 |7|8|    9) Echo-e "You are number is: $Num!"   ;;    *) echo "R error number, game over!"  break;;

Shell Learning Note Five (special characters)

特殊字符 通配符 ?:匹配任意一单子符 *:匹配任意长度字符串 []:匹配其中任意一个字符,*、?在[]中是普通字符 引号 ""、‘‘ 注释符 # #!不是注释,但必须出现脚本的第一行 大括号 变量扩展 ${VAR} ${#STR} 通配符扩展 1、匹配多个排列组合的可能

Two ways to ping a heap of machines (shell or fping)

cat ip.sh#!/bin/bash#--------------------------------------------------   #Created: 2015-04-28# Author:jimmygong#mail:[email protected] #Function:p ing#version:1.0#---------------------------------------

Shell Programming Note one

Shell Programming:Bash Variable type:Environment variablesLocal variables (local variables)        Positional variables        Special variables (built-in)Local variables:Varname=value: Scopes are available for the entire bash process;     

Shell Programming---Character testing and for loops

A. Character test= =: Test for equality, equality is true, not equal to False! =: Test Whether it is unequal, not equal to true, etc as false>-N String: Tests whether the specified string is empty, empty is true, or false-Z String: Tests whether 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 programming (Quick Sort)

#!/bin/bash#shell implementation of the fast sequencing of script programming (with the idea of a meta-point at the far right) a= (8 5 3 2 for 4 1 2 3-9, 8 6) #a = (0 0 0 0 1 2 3 3 4 4 8 30495 921 43716) temp=buff= #交换函数swap () {buff=${a[

Linux learning-advanced shell script programming (I) Functions and shell script Programming

Linux learning-advanced shell script programming (I) Functions and shell script Programming Citation:When writing shell scripts, you will find that the same code or functions are used in many places. It doesn't matter if it's a small piece of code.

Shell disrupt file lines

Shell disrupt file lines The idea is to generate a random array, and then output the row in the file according to the array elements. 1. It is very easy to generate a random array. It was a little difficult to start using it for the first time. The

Total Pages: 541 1 .... 496 497 498 499 500 .... 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.