This article mainly introduced the shell script to match the IP address through the regular expression, this article directly gives the realization code, needs the friend to be possible to refer to under
In the operational dimension scenario, we
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
Use Linux Programmer to enter password This behavior must be not unfamiliar, under Linux to the user has the strict permission limit, does many things crosses the permission to have to enter the password, for instance uses the super user to execute
When writing programs, we often use timers. First look at the Select function prototype as follows:
Copy Code code as follows:
int select (int Nfds, fd_set *readfds, Fd_set *writefds,
Fd_set *exceptfds, struct timeval *timeout);
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 ~]$
Network and Monitoring commands are similar to these: hostname, ping, ifconfig, Iwconfig, netstat, nslookup, traceroute, Finger, telnet, ethtool for viewing linux server IP addresses , Manage server network configuration, establish the network link
1. View all users in Linux
(1) in the terminal. In fact, only need to view the/etc/passwd file on the line.(2) Look at the third parameter: More than 500, is built behind the user. Others are users of the system.
or use cat/etc/passwd |cut-f 1-d:
Objective:no matter what programming language is inseparable from conditional judgment. The shell is no exception.
Copy Code code as follows:
If List Then
Do something here
Elif List Then
Do another thing
Else
Do something
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
Because often use the shell script, so often will write some, but I have never systematically learned the shell script, encountered problems, go to the manual, or Google, to a certain extent to find their foundation is really bad. The following is a
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 "
Shell regular Expressions and grep awk find sed sort uniq cut
One, grep
1, basic parameters
GREP-[ACINV] ' search content string ' filename
-A text file search
-C calculates the number of matched rows found
-I ignores case
-N to output the
Loop execution: Repeats a piece of code 0, 1, or more times;Enter the condition: when the condition satisfies, only then enters the circulation;Exit conditions: Each cycle should have an exit condition to have the opportunity to exit the loop;Bash
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
Shell is a command-line interpreterFor general users, we cannot use the operating system directly (kernel). Instead, it communicates with kernel through kernel's "shell" program, the so-called shell.Why can't I use kernel directly?From a technical
#!/bin/sh#please user the full Path DirectorySitename= "Www.sijisiji.com"prefix= ' Date +%y%m%d 'Cur_bak_name=${sitename} "_" ${prefix} "_bak"Cur_bak_name_gz=${cur_bak_name} ". tar.gz"Backupdir= "/home/backup"Sitedir= "/home/wwwroot"if [!-f
Not much nonsense to say, straight into the topic first function.php can see this method is written in the way array traversal to/config/config.php open config.php see
Use return array () to define all configurations as an
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