Copy Code code as follows:
#!/bin/sh
# Get the first day of the quarter, the date interval to yesterday
# link:www.jb51.net
# DATE:2013/2/28
Day= ' date-d "1 days Ago" "+%y%m%d";year= ' expr substr ${day} 1 4 ';Month= ' Expr
Shell script to extract alert log for Oralce day
Copy Code code as follows:
#/bin/sh
#get Alert of Everyday
#then name of file is everyday_alert.sh
Dir= "/oracle/admin/bbdz/bdump"
num=$ (cat-n ${dir}/alert_bbdz.log | grep "'
Copy Code code as follows:
#/bin/bash
# History
After #把以下代码直接粘贴到/etc/profile
user_ip= ' who-u am I 2>/dev/null| awk ' {print $NF} ' |sed-e ' s/[()]//g '
Histdir=/var/log/.hist
If [-Z $USER _ip]
Then
User_ip= ' hostname '
Fi
if [!-D
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
The shell also has a real debug mode. If there are errors in the script "Strangescript", you can debug this:
Sh-x Strangescript
This executes the script and displays the values of all the variables.
The shell also has a pattern that does not
The first idea, with iptables the external network SSH packet drop off;The second idea, with Tcpwrapper to sshd allow write death;The third idea, revise sshd_config, only listens intranet request.
Due to some unclear reasons, the iptables approach
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 $
Using Python for Web development, it is now popular to use UWSGI to invoke Python programs, but using UWSGI for a period of time to find that there is a disadvantage is that every time you change the source code must restart Uwsgi to take effect,
$#: Number of parameters passed to script$*: Displays all parameters passed to the script in a single string. Unlike positional variables, this option argument can exceed 9$$: The current process ID number of the script run$! : The process ID number
The definition of a variable can only begin with a letter and an underscore, case-sensitive, and may contain a numeric letter underline. See Official Handbook
Copy Code code as follows:
[Root@svn shell_example]# yourname= ' Linux '
[
Embedded beginners, the first time to upload code. Yesterday did a UDHCPD and Udhcpc Guardian, currently only with Shell imitation writing, what method can do guardian?
#! /bin/sh
#进程名字可修改
pro_name=udhcpc
wlan=ra0 while
true;
# get
Linux shell script detects tomcat and restarts automatically
Background Run command sh xxx.sh &View background tasks: JobsSummoned to the front desk: FG Jobs number
The code that can delete the while loop is put into the crontab, and the script
Recently encountered a problem: The machine mail queue is always stuffed, but do not know where to send mail written, very egg pain, no way, only temporary treatment, wrote a delete mail script rm_mqueue.sh.
Copy Code code as follows:
A: This script runs the machine, LinuxB: The machine that installs the JDK, Linux
First, on machine A on which the script runs, determine that you can log on to machine B on the JDK by SSH without a password, and then you can run this script on a:
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.