Reprint please indicate source http://blog.csdn.net/imred/article/details/40951125
Under Linux to see some txt files often appear some garbled problem, so I wrote a shell script to GB2312 code into UTF-8 code
#!/bin/bash
#格式:./gb2312_2_utf8.sh
A problem encountered earlier is that the log file is too large to occupy the disk space and cause the build project to fail
So I wanted to write a timed task. Delete a log or compress a log file
I've been on the internet for a long time and haven't
Positional parameters can be moved left with the shift command. For example, shift 3 means that the original $ $ is now $, the original $ $, and so on, the original $ $, $ $, $ $ no move. The shift command with no parameters is equal to shift
In a production environment, there is usually a large number of resident processes in a cluster, and it is necessary to be able to monitor and recover quickly when a process hangs.
The general Operation Engineer will choose to implement in Python,
If statementSyntax 1
If condition
then command (set)
fi
The condition here is to use the test statement or the bracketed statement (the previous article has been summed up)Note If statement must terminate with FI
Practice:
#if test
if ["-lt"] # "13
Background information:
The project has two log folders, one for Tomcat itself, and two for the project.
This script is used in conjunction with Crontab once a week and can be done without restarting the Tomcat catalina.out normal situation to
Linux for loops can use break and continue keywords to jump out of loops, consistent with Java usage
a common for loop structure
#语法一 for
variable in value 1 value 2 value 3.
Do
program block done
# #语法二 The for
variable ' command '
do
First, there is only one type of string in the shell, no shaping or floating-point type.
However, when you define a variable, you can use single quotes, double quotes, and no quotes. Without quotes, if the variable has a white character inside it,
Some special symbols.
$# the number of arguments passed to the 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
If there is a possibility of a "^m" symbol in the end of a shell script that uses Windows editing
Because MS-DOS and windows are carriage return + line wrapping, so in Linux with Vim to see the code written in Windows VC, after the end of the "^m"
* Inverted quotes ' and $ () * Let's demonstrate a comparison of the output results using the inverted quotes and $ () For this result, is because the $ () in $ () has escaped to get this result because of the two \=\ in the inverted
An application system every day to insert data to the database, and for very early data need to be cleaned from the database, to prevent unlimited data increase, the cost of storage and impact data query efficiency.
Implemented through two files,
Today, when writing a shell script, several commands are strung up to execute, and the previous command fails, and the command is not followed. Google on the Internet, find solutions, using logic and && can.
Here's a summary of how the shell
Original address: http://www.cnblogs.com/Gukw/archive/2012/01/16/2323417.html
1,/etc/gitconfig:[GUI] encoding = Utf-8 #代码库统一用urf-8 to display Chinese in the Git GUI[i18n] commitencoding = GB2312 #log编码, window under the default gb2312,
my first understanding of sed
Sed is an editor, a command-style text editor. SED can be executed as a command in a terminal, or it can be saved as a SED script text-an executable sed script file, and then execute the script file. The SED editor,
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