Linux GB2312 turn UTF-8 shell script __linux

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

Shell script timed task--log compression (delete)

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

"Shell script Learning" shift command learning

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

Linux Shell Single Instance run __linux

#!/bin/sh# **************************************************# * * * Libraries# **************************************************Source/etc/profile;Sleep 2Date= ' date + '%f_%h:%m ' If [x$1!= "X"]ThenDate=$1Fi Echo $DATE Basedir= ' DirName $ 'CD

Shell monitors Java processes and recovers automatically

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,

Shell script [operator expression, conditional control statement]

#!/bin/bash #你值得收藏的四则表达式运算. val1=1 val2=1 val3=1 val4=1 val5=1 val6=1 let val7=1 ((val1++)) val3=$ (($val 3+1)) val4= ' expr $val 4 + 1 ' val5= ' bcecho ' val5= ' $val 5 echo ' val6= ' $val 6 echo ' val7= ' $val 7 You should understand the

Branches in the shell

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

The shell script that backs up Tomcat logs on Linux every week __linux

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 uses shell scripts and cron to implement timed backups, uploads, and garbage-log Cleanup (original) __linux

1. Edit detailappbackup.sh Input: #!/bin/sh#copyright (c) 2010-2011 Luoch (luocheng.cn@luocheng.cn) #Backup The detail files and update, clear logs#version 0 .1.1echo "= = Start deleting logs = =" Rm-vf ' find/opt/apache/htdocs/detail/app/log-name '

Shell programming for loops __HTML5 under Linux

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

"Shell" condition

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,

Linux shell some special symbols __linux

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

A method for Shell to solve syntax error problem

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"

Shell script Programming Basic article--Several special symbols __ programming

* 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

disconf Java Boot shell

1. startup file: service-restart.sh #!/bin/sh # java ENV source/etc/profile export java_home=/usr/local/jdk1.7.0_75 export jre_home= $JAVA _home/jre if [$# != 3]; Then echo "USAGE: $ service_dir service_name_pre disconf_env" echo "e.g.:

Shell script Implementation Delete data in expired database __ Database

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,

Linux Shell Execution Multi-command && and | | __linux

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

Git shell displays Chinese

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,

Linux shell Programming Notes-understanding sed__ block chain

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,

Does the shell associated index subscript have a limit on strings?

#!/bin/sh if [[$#! = 1]]; Then echo $ basepath; echo; Fi path=$1; Declare-a Statearray; (Find $path-type f-print) | while read line; Do #echo "----" echo $line; #echo "----" ftype= ' File-b "$line"; Ftype= ' echo ' $ftype | Cut-f 1-d ""; echo

Total Pages: 541 1 .... 507 508 509 510 511 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.