SHC can be used to encrypt shell scripts, which can be converted into an executable binary file. After SHC the shell script, it generates two new files at the same time, one is the encrypted executable binary (the filename ends with. x), and the
Create child process, parent process exitsThis is the first step in the process of writing a daemon. Since the daemon is detached from the control terminal, the first step is to create the illusion that a program has been completed in the shell
Iterating and traversing the lines, words, and characters in a file is a very common operation when you are working on a text file. Using a simple loop for iterations, plus a redirection from stdin or files, is the basic way to iterate through the
The string interception of Linux is useful. There are eight different ways.
Suppose there are variable var=http://www.aaa.com/123.htm.
1. # Intercept, delete left character, keep right character.
Copy Code code as follows:
Echo
1. Judging variables
Copy Code code as follows:
Read-p "Input a word:" Word
if [!-n "$word"]; then
echo "You have not input a word!"
Else
echo "The word you are $word"
Fi
2. Judging input parameters
Copy
$ #代表了命令行的参数数量, you can look at the following examples:
Copy Code code as follows:
If [$#!= 1]; Then
echo "USAGE: $ tabname"
echo "e.g.: $ cdr_call_20040701"
Exit 1;
Fi
Position parameters $,..., $N, $ #代表了命令行的参数数量,
Using the shell to test the download under Linux, the code is as follows:
Copy Code code as follows:
#!/bin/bash
#date: 20140210
#used for test server download speed
R_host= "188.18.28.19"
R_dir= "/home/test0208/tmp"
r_file= "$r _dir/
I remember last year when I was looking for a job interview, I heard a classmate say that he likes Linux very much, I believe what he said is true, I think the people who like Linux are very happy from the shell script, because it can integrate the
1, configure multiple server logs as long as the $website variable is incremented and separated by a space.2, looping to create the log directory3, after the split with XZ compression, of course, can not be installed with Gzip bzip2 and so on.4,
The daily analysis of the log of the brothers really can't afford to, often need to give pv,uv, independent IP and some statistics, use C/c++,java can write, the process is such, read the file, scan by line, put the value of the tag into the data
1. #annotation function, #! ExceptIn addition, in the parameter replacement echo ${path#*:} here does not represent a comment, a numbering conversion, does not represent a comment echo $ ((2#101011))
2.;
Command line separator, you can write
Script A (test example 1)
Copy Code code as follows:
#!/bin/bash
Echo ' Your are in the '
Q) Call another script file in the current script file?
Method One: Using sourceScript second (test example 2)
Copy Code code as
In a shell, you can pass arguments to a function when it is called. Inside the function body, the value of the parameter is obtained in the form of $n, for example, the first argument is represented, and the second argument is $ $ ...
Examples of
There are 3 main types of shell loops, for,while,untilThe Shell's branch judgment is mainly 2 kinds, if,case
A, for loop
Copy Code code as follows:
#!/bin/bash
For file in $ (ls/tmp/test/mytest |grep SH) The//for in format is
I. Single-select annotations
Lines that begin with "#" are comments that are ignored by the interpreter.
Copy Code code as follows:
#--------------------------------------------
# This is a script that automatically plays IPA,
This article describes the Gearman::xs in CentOS under the compiler installation method, for everyone to learn about!
At present Gearman can support a variety of languages, its official website description is as follows:
Language
Each process will have a PID, and each PID will have a corresponding directory under the/proc directory, which is the implementation of Linux (current kernel 2.6) system.General backdoor procedures, in the PS and other processes to see the tool can
This example describes the Java method for invoking shell commands. Share to everyone for your reference. Specifically as follows:
Recently, the project has such a demand: the system of foreign currency funds after the completion of the dispatch of
Tag: Indicates the return value of the CTR online packet host Images network SRCDetermine which hosts are online in the current network (the ping return value is true, indicating that the host is online)The trap instruction is used to perform the
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