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

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

How to implement automatic Telnet with shell script

Turn from: http://blog.csdn.net/edei2004/article/details/3694021 Many people think that telnet, like passwd and Su, cannot be turned on by pipes and inputs to make it work automatically, but Telnet actually supports input steering. Although,

Shell reads multiple files at the same time

Read two files at the same time, and merge their peers into one line to write to a merged file Shell script: #!/bin/bash #set -x CD ' dirname ' $ '/. / inas_script_root= ' pwd ' function Make_if_no_existis_dir () {local dir=$1 if [!-e ' $

The use of regular expressions in the Shell __ regular expressions

Here are two ways to use the shell's regular expressions. use method One: #赋值给变量var read var #定义regex正则表达式 regex= "[0-9]" if [$var =~ $regex]];then #match #do Something fi For example, to match the input, the requirement must be a number

Java detailed Jaishir (Shell) Sorting __java

Recently looking for a job, do a pen test to sort algorithm, revisit Hill sort, the first time in the look of the times did not understand ... ⊙﹏⊙ b Khan So put yourself in the first time when the code encountered problems to be sorted out, in order

Linux Shell Script Learning notes collation __linux

Specify the script interpreter #!/bin/bash Note: 1, the declaration can only be placed in the first line of the script, indicating that the script uses the Bash interpreter to interpret execution, otherwise it will be interpreted as Comment 2,

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

Linux executes commands independently with output, CGI calls shell script, no output __linux

Call volatility in the shell script, the volatility call is normal when the local test, but when the CGI program calls the shell script, there is no result output ... Why There may be two reasons for the analysis: (1) Permission issues (2) Python

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

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

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

HBASE Common shell commands, additions and deletions to search

First give the data of this operation Create ' student ', ' info ', ' address ' put ' student ', ' 1 ', ' info:age ', ' Put ' student ', ' 1 ', ' info:name ', ' Wang ' put ' student ', ' 1 ', ' info:class ', ' 1 ' put ' student ', ' 1 ', '

Shell parameter Extensions

Recently looking at the script inside the OpenWrt, with too handsome, the following 2 parameters extended expression of large use, all recorded. ${parameter:+expression} If parameter has a value and is not empty, use the value of

Shell Script set command

The set command sets the parameter variables for the shell. The output of many commands is a space-delimited value, and using set is very effective if you want to use one of these data fields. #!/bin/shecho the date is $ (date)Set $ (date)echo the

Write data to SOLR incrementally using the Shell timer task

1. Write the shell script: #!/bin/bash # Performing an incremental import of solr/userinfo Curl ' http://localhost:8983/solr/userinfo/dataimport?command= Delta-import&clean=false ' Echo ' solr-core:userinfo delta-import success. ' 2. Add

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 .... 431 432 433 434 435 .... 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.