This article mainly introduced the Linux Shell script view numa information, this article directly gives the script implementation code, needs the friend may refer to under
Nova provides NUMA-related advanced features in the NFV scenario, which
The Bourne Shell's if statement is the same as most programming languages-the detection condition is true, and if the condition is true, the shell executes the code block specified by the IF statement, and if the condition is false, the shell skips
The shell script reads data in several ways:1. keyboard input, default2. read from the file3. Pass through Pipeline command
Functions of Echo:\c: No Line change\f: Paper Feed\ t: the jump Grid\ n: Wrapping Line\ represents escape, for example:
The bash shell supports only one-dimensional arrays, but there are no restrictions on the number of arguments.Declare an array:Declare-a Array(In fact, you don't have to declare that you can assign a value directly to a variable in an array, and
Many times, we will write a shell program to complete some of the time without duplicating the wheel, but because the shell statement will also have functions, there will be variables, in the end after the implementation of what related operations,
1, look at the machine installed which shell?
There are two ways to view it.
First type:
[Rocrocket@wupengchong ~]$ Chsh-l/bin/sh/bin/bash/sbin/nologin/bin/zsh
The second type:
[Rocrocket@wupengchong ~]$
Today found a system to detect the integrity of the shell script, I tried it can be, introduced to everyone.System: CentOS 5.xScript content:
Copy Code code as follows:
Cat my_filecheck.sh
#!/bin/bash
#
# variable first declared to use
Today suddenly think of a problem has not hands-on practice, is the use of Shell batch modification file suffix, now hands-on practice.
Requirements: The home directory has some SQL files, want to bulk renamed into TXT
1, find + xargs +sed
There are now port-proof tools, such as Psad, Portsentry, but feel the configuration is a bit cumbersome, and the server does not want to install an additional software. So I wrote a shell script to implement this function. The basic idea is: the
First, the method
Copy Code code as follows:
/**
* Execute a shell command and return the string value
*
* @param cmd
* An array of command names & parameters (for example: {"/system/bin/cat", "/proc/version"})
* @param workdirectory
The shell processing DB2 database, which is written for work needs, extracts DB2 data from the shell and processes it.
#SQL文定义
Sql= "SELECT AAA, BBB, CCC from MYTBL1"
#执行SQL
Sdata= ' DB2 ' "$SQL"
#返回值判断
If [$?-ne 0]
Then
#显示db2返回的错误信息
echo "
Hell Programming--for in loop-------in format-------
For no $ variable in string
Do
$ variable
Done
A simple string to enumerate through the calendar, with the function of using the in format to cut the string by a space
As a Linux little white, just learn a little bit to remember:When deploying the server. It is often necessary to view the console output as a local, to be able to view the log output in Linux, and, of course, to have the log displayed in real time
Linux version: CentOS 6.7//Can be viewed using lsb_release-aFirst, modify the/etc/mail.rc//on the last side of the line, you can also echo >>Set [email protected]//your own real e-mail addressSet smtp=smtp.exmail.qq.com//In mailbox settings, client
Bash's built-in string processing tool:String slices:${var:offset:number}Takes a substring of a string;Take the rightmost few characters of the string: ${var:-length}Note: There must be a white space character after the colon;To take a substring
Objective: To monitor the operation of Nginx and NFS services in the cluster, such as any service exception, send an email to notify the userCondition: 1. Host and the IP address of the sub-machine, hostname has been determined;2. The host and the
In a shell script, the $ A is typically used to display the name of the script, which displays the path name of the script when not using basenameFor exampleCat test5.sh #!/bin/bash # Testing the $ parameter echo the zero parameter is set
The IF statement determines which branch to execute by using relational operators to determine whether an expression is true or false. The Shell has three kinds of if ... else statements:
If ... fi statement;
If ... else ... fi
Set font and background color under BASH shell\e[30m change the display color of a character to black\e[31m change the display color of a character to red\e[32m change the display color of a character to green\e[33m change the display color of a
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.