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 "'
First, the arithmetic operation
Copy Code code as follows:
+ - * / %
second, the relationship operation
Copy Code code as follows:
>=
Third, the test operation
Testing command: Test [] [[]] [(
About the shell in the for loop usage a lot, always want to sum up, today on the Internet to see a summary of the use of the loop, feeling very comprehensive, so turn around research, HEI ...
Copy Code code as follows:
For
Shell version Nginx log spider crawl View script
Change the path of the Nginx log before usingIf more spiders themselves in the code Spider UA array Riga can
#!/bin/bash
m= "$ (date +%m)" Case
$m in
"") m= ' before ';;
") m= ' Feb ';;
"
In the previous example of Shell programming, it was mentioned that the shell script was extended and redirected to a file for viewing and debugging http://www.jb51.net/article/62435.htm. However, if there is another situation: redirect only in some
The recent local virtual machine space is always backed up to fill, in order to lazy don't want to log up every day to clear, just write this automatic cleanup script.
System: CentOS 5.x
Script content:
Cat make_room.sh
Copy Code code as
Today colleagues found that the internal server's hard disk space is not enough, there are many backups, I can not delete, and found a 320g hard disk mounted, want to later the shell script backup to the new hard disk, to make room for the old hard
The TR (translate abbreviation) is used primarily to remove control characters from files or to convert characters.
Syntax: TR [–c/d/s/t] [SET1] [SET2] #SET1: Character Set 1;set2: Character Set 2-c:complement, replace the characters except SET1
1. Get the file name of the current script, including the path.
Copy Code code as follows:
#写一个测试脚本
Vim test.sh
#内容如下
Dirname$0
Basename$0
#执行一下
bash$ (PWD)/test.sh
#输出如下
/home/jane
test.sh
2. $n get the
When porting JSP pages on Windows to a Linux environment, it is too slow to find a transform encoding and modifying the default encoding type, write this script to attempt file traversal ~
Long time no write, Rusty.
Copy Code code as
Problems encountered today, how a user such as WWW permissions replicated to my users?
Permissions for the directory representation: dwrxr--r--
Where the first character d represents the directory,-representing the character w is writable, and R
1. A streamlined script for automating the deployment of systems, with the main function of cleaning up all directory logs
2. According to the given log directory, delete time combined with crontab to clean the log, clean up after completion, after
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:
Here is a brief description of a bash script that you wrote to detect if a process exists. directly on the code.
Copy Code code as follows:
#!/bin/bash
ps_out= ' Ps-ef | grep $ | Grep-v ' grep ' | Grep-v $ '
result=$ (echo $ps _out |
Speaking of function calls, I believe that we will not be unfamiliar, however, for beginners shell of me, the shell function call Way is a little let me not too accustomed to, I have gone a lot of detours, because the transfer parameters when a very
In the scripting process, the input of parameters is usually involved. For example, SH 1.sh 10 20, in the execution 1.sh this script, 10 is the first parameter, 20 is the second parameter. Sometimes, there is this confusion, that is, how many
Copy Code code as follows:
#!/bin/bash
Echo-e ' Date +%y%m%d%h%m '
Echo-e "Pid\t\tswap\t\tproc_name"
# Take out all directories in the/proc directory (the process name is the number is the process, others, such as sys,net, etc. store
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