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
Gzexe
Installation and use
The system is self-contained with no installation required.Use the following command to encrypt:
Gzexe tesh.sh
After the encryption is complete, test.sh is the encrypted file, while the source file is backed up as test.
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,
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 ' $
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
Shell script, if judgment statement error [: Too many arguments
I have encountered two situations:
1, the first situation is that the Internet, you can say, the string variable may exist in a space, shell resolution when it is considered to be more
Often to deploy multiple servers above the application, if a machine's login too cumbersome.
All just think about writing a script to deploy different servers
Prerequisites:
Configuring SSH Login Free
If not, please join me in another article http://
Shell judge file, directory exists or have permissions #!/bin/sh mypath= "/var/log/httpd/" myfile= "/var/log/httpd/access.log" #这里的-x parameter judgment $ Whether the MyPath exists and has executable permissions if [!-X "$myPath"]; Then mkdir
Cut-and
The Cut command extracts text columns from a text file or text stream.
Cut syntax
[root@www ~]# cut-d ' delimited character '-f fields
The PATH variable is as follows
[Root@www ~]# echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/
2017-10-04 Add background account:
Suse10, Huawei Veneer, the first four methods are small white in the actual Linux environment test results, may be the difference between Linux version, and not all scenarios are compatible ... Another small white 2
1, the Linux shell to get the process ID method: ps-a |grep "/usr/sbin/gps_app" | awk ' {if ($ = = ' start ') {print}} 'Pidof "CmdName" Pgrep "CmdName"
The results of these three kinds of operations in bash and BusyBox ash are slightly different,
One: Cat command
Cat (CONCATENATE) is one of the commands that the command line player must learn first, and he is usually used to read, display, and splice files, but the cat's ability is much more than that, with a line of commands to combine data
If the file is a. css file or a. js file, it is processed.
File=$1
if ["${file##*.}" x = "css" x]| | ["${file##*.}" x = "JS" x];then
Do something
Fi
Attention:
1> extract file suffix name: ${file##*.}
# #是贪婪操作符, matching from left to right,
Problem description
A few days ago, a friend needs real-time monitoring of a Linux system under a process, when the program is running to continue to monitor, when the program is finished to the end of a word to the end, and do follow-up.
Problem
To sort an integer element in the ArrayList collection in ascending order:
Package org.hyp.test; Import java.util.ArrayList; Import Java.util.Random; public class Mysort {private arraylist list, public arraylist getlist () {return list;} PU Blic
http://blog.csdn.net/special23/article/details/52690057
Service-side programs generally need long-term background stable operation, in addition to ensuring the robustness of the program itself, but also need to use some daemons.
Now share a simple
SET Command
The set command acts primarily to display shell variables that already exist in the system, and to set new variable values for shell variables. When you use set to change shell attributes, the function of the symbol "+" and "-" is to
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