Loop statements are often used when writing shell scripts. Here a simple summary of the commonly used 3 kinds of circular statements, so that later can quickly reference to write, nonsense do not say, start Demo:
1, for
Used mainly for:
Linux must use the Linux shell command . Nonsense! You don't know any Linux commands , such as Ps,grep,ls, but you can still use a lot of modern Linux desktop distributions.
Linux system administrators are not like desktop users, they don't
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
Now on the market to sell U disk, from the material, there are metal u disk, silicone u disk, Jade U disk, Plastic (PVC) u disk and so on. One PVC and silicone disk is more popular. However, most users are still difficult to distinguish between the
1. Send mail in command line mode
1.1 Installation SendEmail
2.2 Using SendEmail and examples
2. Command line mode of receiving mail
2.1 Installation Getmail4
2.2 Configuration Getmail4 and simple examples
2.3 Using Munpack to extract attachments
Script content:
Copy Code code as follows:
#!/bin/bash
For IP in ' cat ip.lst '
Todo
./ssh.exp $ip >/dev/null 2&>1
Done
nk= ' awk ' begin{bs=4000000}/access/{if ($1>bs) {Nk=nr-1;print nk}} ' Exp.log '
For NNK in $NK
Todo
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:
In the *unix system, the commonly used shell has sh,bash,csh/tcsh, ksh.
SH comes from SystemV Unix, is the traditional Unix shell, until now many system administrators still like to use SH.Bash comes from BSD Unix, the syntax is very similar to C,
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
A regular expression is a literal pattern consisting of ordinary characters (such as characters A through Z) and special characters (called metacharacters). This pattern describes one or more strings to be matched when looking for a text body. A
The benefits of using an if statement in a shell script are: You can decide whether to perform an action based on a specific condition (eg: determining whether the backup directory exists), and perform different actions when different conditions are
What is a shell?
A shell is a special function program that is a interface between the core program (kernel) of the user and the Unix/linux operating system. Why do we say that the shell is an intermediary between the system's core program and its
We know that the registry is a very important part of the Win7 system, the registry is the same as the system of the database, the control of the entire computer data, it is important to say that the file in the registry, can not be arbitrarily
#!/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
Summary: Chapter Three discusses the two basic operations that are commonly used when writing shell scripts. The fourth chapter introduces about 30 useful tools for processing text files.Chapter III Find and replaceSummary: This chapter discusses
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
Here document usage for Linux shell (cat What is here Documenthere Document is a special redirection method in the Linux Shell, and its basic form is as follows CMD its role is to pass the contents of the two delimiter (Here Document content section)
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.