Cat/proc/meminfoCat/proc/cpuinfoIpcs-aIpcs-mIpcs-sIpcs-qMkdir-p name when the parent directory does not exist is to create itINFOCMP VT100Echo $TERMXtermKonsoleGetconf Long_bitArchRelease= ($ (Lsb_releaseCD-RZ szecho $PS 1Ls-f (after the directory
One: Shell conceptThe word shell is unfamiliar, meaning "shell" is a layer of interaction between the OS core and the user, in a Linux system, the user can use the command terminal, the shell command down to convey their wishes,Drive kernel to
The while loop is applicable to scenarios where the number of loops is unknown.Syntax format: While conditiondo statement ...... Done Note: While is used to execute a loop when the condition is set up. When the condition is invalid, the loop is
#! /Bin/bash
While[1]
Do
A = $ (ifconfig eth0 | grep'Rx PAC'| Awk'{Print $2 }'| Awk-F:'{Print $ NF }')
Echo-ne"$ A \ r"# Refresh data without line breaks
Done
Echo Parameter number:-N. Do not wrap the line at the end.-E
The case structure in bash, which can be used for multiple branches.Case "$ Var" inCondition1);;Condition2);;*)Default statments ;;EsacFor example:#! /Bin/bashEcho "hit a key, then hit return"Read keypressCase "$ keypress" in[A-Z]) echo "uppercase
#! /Bin/bashA = $1 # pass the first command line parameter to variable A, and the second command line parameter to BB = $2If [-Z $ A] | [-Z $ B] # determines whether a and B are empty. If one is empty, print the prompt statement and exit.ThenEcho
1). Background:During cluster deployment, consistent configuration and environment settings are required. for Virtual Machine clusters, you can copy, copy, and restore cluster machines by using images. different from physical machine clusters, if
I. For LoopFor VaR in [LIST]Do# Code blockDone$ VaR is a loop control variable. [LIST] is a set that VaR needs to traverse. The do/done pair contains the loop body. If do and for are written in the same line, you must add ";" before do, for example,
I. general Variables
#/Bin/sh
Num = 2
Echo "this is the $ {num} Nd" # If the shell script language variables are tightly connected to letters, add.
Output result:
Ii. System Variables
$ #: Number of command line parameters for input scripts
#! /Bin/bash
Hello = "var1"
Echo $ hello
Function func1 # define function func1
{
Local Hello = "var2" # define the internal variable hello
Echo $ hello
}
Func1 # Call a function
Echo $ hello
Execution result:
Conclusion: local variables only work
Tag: $ {} ''$ () Shell
$ (), ''For command replacement
$ {} Is used to replace variables (the following content is from shell 13)
(1). Definition of Variables
$ A=B $ echo $AB
When executing this command, the AB is regarded as a
Since HDFS is a distributed file system for data access, operations on HDFS are basic operations on the file system, such as file creation, modification, deletion, and modification permissions, folder creation, deletion, and renaming. Pair
HDFS
(1) it must start with the following line (the first line of the file must be placed ):#! /Bin/shSymbol #! The program used to tell the system to run the script. This example uses/bin/sh. After the editing is completed and saved, it is assumed that
1. you can set the number of servers to be checked and the server to check. You can set the IP address of the non-Online host and the corresponding time of the non-Online host, and collect statistics on the number of non-Online hosts saved to the
Every time you create a new script, you must add # In front of the script #! Some fixed text such as/bin/bash. The bash Script Creation script can automatically add information such as Bash and date author. After the creation is complete, the system
The TR command does not accept specified file parameters, but only translates standard input. tr is short for translate, that is, translation. Note that it cannot translate sentences, only one character can be translated.
First, define the variable:
After we grant the shell script execution permission, we can test the program. Assume that the shell script file is hello. Sh.In the/root directory. The following describes how to execute shell scripts on a terminal:1. Switch to the directory where
TR is used to delete control characters in a file or convert characters.Syntax: TR [-C/D/S/T] [set1] [set2]Set1: Character Set 1Set2: Character Set 2
-C: complement. Use set2 to replace characters not included in set1.
-D: delete all characters in
Convex hull diameter
Detailed description of convex hull diameter
// Calculate the convex hull diameter. Input convex hull Ch. The number of vertices is N, which is arranged counterclockwise. The square of the output diameter
Int rotating_calipers
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.