My configuration is the Linux, android4.2.2 SDK. The implementation details are in the code comments, and the variable name and echo content are part of the description.
The main process is:
1. The simulator that detects whether the port is
Description: The subscript for an array in the shell defaults to the 0 start
1, put the string in the array, get its length
Copy Code code as follows:
#!/bin/bash
Str= "A B--n D"
Array= ($STR)
length=${#array [@]}
Echo
Copy Code code as follows:
#!/bin/sh
# Desc:setup Linux system security
# AUTHOR:CORALZD
# Powered by www.freebsdsystem.org
# version 0.1.2 written by 2011.05.03
#account Setup
Passwd-l XFS
Passwd-l News
Passwd-l NSCD
Passwd-l Dbus
=================================================
This article for Khler original, reprint must ensure that this article complete and completely retain the original author information and this article original
In the operational dimension scenario, we often need to match the IP address with a regular expression on the server.
The shell, like other programming languages, can also use regular group captures, but you cannot capture groupings in the form of $
1. Preface
Almost six months did not write a blog, deserted for a long time, the work of the chores too much, their own more and more lazy. In order to spur their own growth, or adhere to write a blog, record their growth.
2. Introduction to Shell
The real-time traffic of the NIC can be viewed through the Iptraf command, and the image is very intuitive.
I'm going to look at the network traffic on the test server today.
Copy Code code as follows:
[Root@localhost ~]# iptraf-d eth0
-
To ensure that the PHP page runs in the background, write a monitoring script, assuming that the program exits unexpectedly, you can automatically restart.
Shell Script/usr/local/scripts/receve.sh content:
#!/bin/bash
#funtion: Keep
The most recent script always needs to be computed, and every time awk is cumbersome, it encapsulates the subtraction of awk, and each time the direct source math.sh is invoked.There are some points to be pointed out so as not to forget in future
If you want to add a character after a variable, you can use the method:
Copy Code code as follows:
$value 1=home
$value 2=${value1} "="
Echo $value 2
Add the string variable you want to add {}, and you need to put $ outside.The
1 Prepare the monitoring machineLinux system, normal server can, request:Install SSH client, if you want to send SMS, also need to prepare SMS cat and install Gnokii or Gammu
2 Edit ssh_config configuration file/etc/ssh/ssh_config configuration
The content of this section:Keep the specified number of files remaining under the file system
Example:
Copy Code code as follows:
#!/bin/bash
#-------------------------------
#Description: Back Up your files
#site: Www.jb51.net
#--
When the server pressure is larger, running very laborious time. We often do Site page optimization, will go to find those pages are more frequent, and more time-consuming. Find the addresses that are high and time-consuming, and the related
Copy Code code as follows:
#include
#include
#include
#include
int main (int argc,char **argv)
{
int mode;
int Mode_u;
int mode_g;
int mode_o;
Char *path;
if (argc{
printf ("%s \n", argv[0]);;
Exit (0);
}
1. The problem addressed
When you need to enter many commands at once, for example, to remove files from multiple directories at once
Copy Code code as follows:
CD Dir1
RM file1.temp
Cd.. /.. /dir2
RM-RF Dir3
When you
Demand
I wrote this script two days ago when I met the need to extract a file in a 10-story folder.
A file structure like the following:
Copy Code code as follows:
Dir1
├──a
│├──b
││└──file1
│└──file2
├──c
│└──d
│├──e
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