Shell Scripts (1)a Shell script is a special application that receives the operation commands entered by the user and interprets them, passes the actions that need to be performed to the kernel execution, and outputs the execution results. You can
1, first LDD is not an executable program, but just a shell script2, LDD can display the dependency of the executable module, the principle is by setting a series of environment variablesAs follows: Ld_trace_loaded_objects, Ld_warn, Ld_bind_now,
Shell Popular Understanding: Translate user-entered commands to the operating system.The Shell is an interactive command interpreter. The shell is independent of the operating system, which gives the user the flexibility to choose the right shell
When using bash to start a program, you can use the program to add &, the implementation of the program in the background to run; Example: Emacs & But if you forget to enter &; but you do not want to stop the program after restarting; You can do
What is a function? Why do we use a function?I. Related knowledge of functionsThe function is to package the code with a specific function and provide an interface for use. The advantage of this is that code reuse can be achieved on one hand, for
Requirement-driven Linux Shell Programming
Requirement-driven Linux Shell programmingtable of Contents
1. Where can I find the basic Material about Linux Shell programming?
2. How to time a function/program (Get the execution time of a
The first part: Shell introductionCommand Interpretation Language programming languageWhen a user logs on to a Linux system, a shell process is created for that user.Shell version:Bourne Shell: A shell developed by Bell Labs that is commonly used by
Using sh to write some small scripts will make the work easier, and some content may be unfamiliar to everyone (at least I am ),It is variable-related parameter expansion. Below are some simple descriptions and usage, which can make the code more
I. For LoopFor VaR in [LIST]Do# Code blockDone$ VaR is a loop control variable. [LIST] is a set that VaR needs to traverse. The do/done pair contains the loop body. If do and for are written in the same line, you must add ";" before do, for example,
Use the date command to convert the Basic time second to year, month, and day: Command: Date-d @ 1281161747 Be sure not to forget the symbol "@" # Obtain the current time by date # Date-d "-1 week" + % Y % m % d get last week date (day, month,
Note: To use this shell, you must first successfully create the memcache environment 1 and create the memcached file and permission [email protected] ~] # Touch/etc/init. d/memcached [[email protected] ~] # Chmod + x/etc/init. d/memcached2 write the
The structure features of all return texts are as follows:
If the number of characters is an even number, it is structured as: A Character Sequence is connected to another character sequence with the same but the opposite order.
If the number of
Tag: Please user null
Syntax format
Function Name (){
Function body
}
Function Name
--------------------------
Function body can contain command loop judgment
Example: Determine whether a user exists. The output user ID and shell exist.
#!
[Copyright statement: reprinted. Please retain the Source: blog.csdn.net/gentleliu. Mail: shallnew at 163 dot com]
In this section, let's take a look at a w k's many powerful string functions and their usage methods.1. sub and gsub functions:
Usage:
The raw data is in the final baiang.txt file.
Shell command:
Cat ‑qiang.txt | grep-P "^ country | ^ ☆" | awk-F" "'{print substr ($2, 1, 2 );} '| sort | uniq-c | sort-NR
The result is as follows:
27 Jiangsu22. Shandong Province18 Zhejiang10 Liaoning7
Requirement: traverse all APK installation packages and install them in batches.
Idea: there should be many ways to implement it, but I am not familiar with shell commands. I chose the simplest one. The find command should be simpler and updated
Use zjdroid to unshell an APK that is encrypted and shelled.
Although this cainiao has some coding experience, it is the first time to crack the code. This time I encountered some problems when I used zjdroid to shell an APK, So I recorded that I
(Linux shell) Chapter 1-test the knife (on) and test the knife
Source: (linux shell) Chapter 1-test tool (I)
From today on, let's take a look at the book "linux shell script strategy.
1.1 Introduction
A shell script is usually #! The starting text
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