As you know, you can use shell to output information to the screen. However, if the output content is too large and redundant, it is not easy for us to analyze and extract the screen information we want, so how can I write shell output into a file?
File22924 183.136.221.76 20020747 119.146.204.15 20019563 61.182.133.37 20019150 112.85.218.29 20018002 113.106.128.3 200123 113.106.128.3 200
File B113.106.128.31.1.1.161.182.133.37
Ladies and gentlemen, how can we print out all the records of
Shell variables:(1) The variable and the variable content are connected with the equal sign "=;(2) The equal signs cannot be directly followed by space characters;(3) The variable name can only contain English letters and numbers, but cannot start
Http://tech.foolpig.com/2008/07/09/linux-shell-char/
Shell string truncation problem:1. Linux Shell intercepts the first eight characters of the character variable by using the following methods:1. expr substr "$ A" 1 82. Echo $ A | awk '{print
How to run a script
Three methods:
Absolute path:/tmp/shell. Sh
Relative Path:./shell. Sh
Variable path: Put the directory where the script file is located in path, and then shell. Sh
Below is a simple script
And learn anyProgramming
1,Echo $?: An exit status is returned when any command is running, and the exit status of the previous command is output,0Indicates that the exit is successful.
2, Test File status:[-W text]Test whether the file can be written,Echo $?The output is0
InShellProgramming.You can use parameters.ShellLocation and Internal Parameters
1
,Location parameters
The parameters provided by the system are called location parameters. The value of the location parameter can be used $ N Get, N Is a
Transferred from: t00lsExp, a vulnerability circulating on the internet, indicates that the backend can be used only if the plus directory exists and the server can be connected externally._ 1 U-T (B-F8 CPrerequisites: You must prepare your own Dede
The flexible combination of Linux/Unix shell and SQL variable transmission greatly improves DBA efficiency, this article provides a few simple examples of passing variables between Linux/Unix shell SQL statements for your reference.
Call SQL in
#/Bin/sh
# Add By zhoujf. Free log file;
Dir_list = "/product1/port/bin/ocs_subscriber_import/back"
Log_list = "* 201 *. unl"
Gz_day = 3Del_day = 30Core_day = 7
Cur_time = 'date + "% Y % m % d % t "'Echo "start at [$ cur_time]"
For dir in $
This post was last edited by ps49324955Integer comparison-------------------------------------------------------------EQ equals to, for example, if ["$ A"-EQ "$ B"]-Ne is not equal to, for example, if ["$ A"-ne "$ B"]-GT is greater than, for example,
The daily log analysis team is really sorry. We often need to provide statistics such as PV, UV, and independent IP addresses. C/C ++ and Java can all be used to write logs. The process is like this, first, read the file, scan it row by row, put the
1. Read options
Read can have eight options:-A,-D,-E,-N,-P,-R,-T, and-s.
-: Read the content into the value
echo -n "Input muliple values into an array:"read -a arrayecho "get ${#array[@]} values in array"
-D: Delimiter, that is, the delimiter.
Check/set system services
chkconfig Display Process dynamics
Top. Common performance analysis tools in inux can display the resource usage of various processes in the system in real time, similar to the Windows Task Manager.
Detailed explanation
The case statementthe case statement is good alternative to multilevel if-then-else-fi statement. It enable you to match several
Values against one variable. Its easier to read and write. Syntax:
case $variable-name in
From: http://www.cnblogs.com/hanyan225/archive/2011/10/06/2199652.html
There is no doubt about the strength of shell, which makes it easier for us to confuse us. For example, I have always thought that I am smart and cannot tell you clearly.In Shell,
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