This article mainly introduces the shell script to determine whether the IP address in an IP segment code sharing, this article directly to the implementation code, the need for friends can refer to the
?
1 2 3 4 5 6 7 8 9 10 11 12 13 1
In Linux, the/proc/$PID/status file provides the usage of the process resources (memory, stack, semaphore, child parent process), although Linux provides a lot of commands to view memory, but it's all about the overall usage and cannot view the
ECHO is an internal instruction of the shell to print out the specified string on the screen. Command format:
Copy Code code as follows:
Echo Arg
You can use echo to achieve more complex output format control.
Show escape
This paper briefly introduces the method of Gearman using MySQL, and some problems caused by it, the detailed analysis is as follows:
First, Gearman create a MySQL persistence queue in the following ways:
1. Log into the MySQL command line and run:
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
[grep Introduction:]
grep is used to filter rows that contain specific characters, and to use regular expressions to search for text that is selected in positive behavior units when looking up a string in the data.
Usage: grep [Cinvs] ' pattern '
Learn shell programming, every time to do a test, always create a file, give permission, file each edit also write a #!/bin/bash, when the test files are more, still have to organize, or move, or delete ... Kiss, don't bother ...
Here are some of
Environment:
SSH server:192.168.100.29 server.example.com
SSH client:192.168.100.30 client.example.com
Create secret key authentication through root user to implement Shell script management, distribution, deployment
First, the client side
This article mainly introduces the basic syntax of if and common judgment usage in the shell, this article explains the basic syntax of IF, the judgment of the string, the judgment of the number, the judgment of the file attribute, the logic
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
In the shell, send a signal to the process a lot through the CTRL key plus some function keys to achieve, here is the common CTRL key combination and its meaning:
Key combinations
Signal type
Significance
CTRL +
Because my normal working environment is Linux, so inevitably use command line mode and shell script, and some command line every day to lose many times, such as SSH login, so simply put the usual commands are written script files, so deliberately
Some good habits of shell scripting
1. Naming rules
The script name ends with. SH, and names are as famous as possible. Here are a few of the script naming styles that are available for reference. Through the following fresh and
#! /bin/shLook for Shell interpreter/bin/sh is a path#! /usr/bin/pythonJust looking for a Python interpreter.Ways to execute a Linux program:Enables the file to execute directly with executable permissionsInvoke the interpreter to runUse Source to
I. Introduction to Linux Shell1. Shell overviewThe shell is an interface that the user interacts with the kernel, and the most popular shell is now called the Bash shellThe shell is a programming language The Shell is a scripting language, so you
#!/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
In the previous blog, we introduced some of the features of Shell programming, namely command aliases, command history, shortcut keys, command completion, command line expansion, command execution results, escape characters, wildcards, IO
When analyzing a complex script, it is sometimes necessary to pause, in a segmented view, to be more clearSo the reference to some of the implementation, the current own use is such a son#add forDebug by ZqbfunctionGet_char () {Savedstty= ' Stty-g '
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