Take a look at the wrong code first.
Copy Code code as follows:
#!/bin/bash
For x in ' LS */.*/.* '
Cat $x |do Echo $x
While Read line
Todo
C= ' echo $line |awk-f ' (' {print '} '
#echo $c
i=$ ((i+ $c))
Done
Echo
Done
Echo $i
Binary comparison operator, comparing variables or comparing numbers. Note the difference between numbers and strings.
Integer Comparisons
-eq equals, such as: if ["$a"-eq "$b"]
-ne is not equal to, such as: if ["$a"-ne "$b"]
-GT is greater than,
*-B Returns True when file exists and is a block file
*-C Returns True when file exists and is a character file
*-D returns True when pathname exists and is a directory
*-E Returns True when pathname specified file or directory exists
*-F returns
Each line that the Shell reads from standard input or script is called a pipe (pipeline); it contains one or more commands (commands) that are separated by one or more pipe characters (|).
In fact, there are many special symbols that can be used to
Copy Code code as follows:
#!/bin/bash
Send_thread_num=13
Tmp_fifofile= "/tmp/$$.fifo" # script runs the current process ID number as filename
Mkfifo "$tmp _fifofile" # Create a new random FIFO pipeline file
exec 6<> "$tmp _fifofile" #
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
Example:A is a local host (that is, a machine used to control other hosts);b is a remote host (that is, a controlled machine server), if IP is 192.168.60.110;Both A and B systems are Linux.
To run a command on a:# ssh-keygen-t RSA (three
1. Install MSMTP
luther@gliethttp:~$ sudo apt-get install msmtp
2. Edit the configuration script (~/.MSMTPRC is the default profile, or you can specify the profile path using the-C option)
luther@gliethttp:~$ Vim MSMTPRC
#添加如下内容
Defaults
#logfile/
The Nova provides NUMA-related advanced features under the NFV scenario, which provides a script to view the NUMA-related information for compute nodes.
#!/bin/bash function Get_nr_processor () {grep ' ^processor '/proc/cpuinfo | wc-l}
Writing a:
Copy Code code as follows:
#!/bin/bash
While Read line
Todo
echo $line #这里可根据实际用途变化
Done
Writing two:
Copy Code code as follows:
#!/bin/bash
Cat Urfile | While Read line
Todo
Echo $line
Oneself in the VPS do kingate service end, estimated the recent occupancy flow is too big, always be the service provider put my VPS reboot, but kingate this thing is once forced to end, is not boot, because to kingate.pid this file deleted to start,
This script has been tested on the Ubuntu and CentOS versions, and the script is as follows:
Copy Code code as follows:
#!/bin/bash
Line= ' =========== '
#linux发行版名称if [[-f/usr/bin/lsb_release]]; Thenos=$ (/usr/bin/lsb_release-a
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
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
Today, when writing a shell script to find that you need to set the user's password, and set the password is interactive, so in the script is obviously not very good, so the Internet to find data, found the following two common way to set the
Many of the shell scripts executed with Cron may take a long time to execute for a variety of reasons, and it is necessary to check whether they are still running while running. This article provides a Linux shell script to check with the command sh
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