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
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
1, shell overview
Each person after successfully logged on to Linux, the system will appear a different hint symbol. For example, $, ~, #等, and then you can start typing the command you want, and if the command is correct, the system will execute
Shell programming
All the code is to simple basic sentence assembly, according to their own will to write, and finally get the desired functional program.
1, the beginning: #. /bin/bash
#。 Is the program that tells the system to follow the
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://
Recently started to learn bash shell, I do not know where to start, do not know what a good tool package to learn it. First Look for:
yao@wuyao:~$ Apt-cache Search BashApparix-console-based Bookmark Tool for fast file system navigationBackup-manager-
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"
if [str1 = str2] When two strings have the same content, the length is true
If [str1!= str2] True when string str1 and str2 are unequal
If [-N str1] is true when the length of the string is greater than 0 (string non-empty)
If [-Z str1] is true when
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,
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,
Today continue the last Find command content, mainly find and-exec and xargs combination and use.
(9) The Find command can be combined with other commands with the help of an option-exec. -exec is one of the most powerful features of find.
For
This article writes that Java invokes the Linux shell command and returns the result as a stream.
The following is directly on the code, the code is annotated.
Very plain and easy to understand.
Import Java.io.BufferedReader;
Import java.io.
1. Read command
The read command reads information through a keyboard or a line of text in a file and assigns a value to a variable.
1.1, read reading the keyboard data, the input of the content before the return of the data assigned to a variable:
I wrote a Java program with the main method entry, already packed a jar and already started running under UNIX, but I wanted to write a script file to make it easier for managers to start and shut down my Java process. Similar to Tomcat
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
Listen to people say that text classification when processing 100G text files, incredibly without big data, processing method is to use the shell split to split into a number of small files.
Split command
NAME split-split a file into pieces
The previous writing test program used scripts to raise interest, combined with specific cases, to test the results of learning. Finally understand a slightly more complex shell script. There are still a lot of technical things in there.
Declared
seq 1 100The notation of the seriesWc-l count Rows-C bytes-W wordsbasename returns a basic file name for a stringDirName leave the non-directory part except the file nameRead-p "" Name prints a hint and waits for input input information to be given
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