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
Shell script error: "[: =: unary operator expected"Md5_109a = "81ab961153b62d207f0f517048881b5d"Md5_1_ B = 'md5sum install. Bin | awk '{print $1 }''If [$ md5_109a! = $ Md5_1_ B]Cause: when the file install. Bin does not exist, $ md5_1_ B is empty so
Http://southking.javaeye.com/blog/613089
Run the. Sh script in Linux./bin/sh ^ m: Bad Interpreter: no such file or directory is abnormal.
Analysis: This is caused by different system encoding formats: The. Sh file edited in Windows may have
I encountered a problem today,
The shell script (test. Sh) is as follows:
#! /Bin/shecho "Export monitor = 1">/etc/profilesource/etc/profile
After the call (./test. Sh), execute echo $ monitor without outputting any value, but the profile has
A shell script must have been written as follows:
If [-D dir]ThenEcho "success"ElseEcho "failed"Fi
When talking about if, the book will mention the following two rules:
1. There must be spaces on the left of "[" and;
2. If you want
The example above the Linux Shell script illustrates the conversion of decimal and binary, and ends the learning of this Part with an instance related to file loops. I believe that the basic learning of Linux shell scripts should be able to master
1. Conditional Test
Use the test command for files, strings, and numbers
Use the expr command for numbers and strings
Expr command to test and execute numerical output
1. Test File statusTest generally has two formats:Test Condition[Conditon]-D
Example:
Add a shellapi unit to use
VaR
Filepath: string;
Shellreturn: integer;
Begin
Filepath: = file path + file name
If filepath <> ''then
Begin
Shellreturn: = ShellExecute (handle, pchar ('open'), pchar (filepath), nil, nil, 1 );
If shellreturn
Themida 1.8.x shell-removing bubble Hall No-dead plug-in 3.16
Themida 1.8.x shell-removing bubble Hall No-dead plug-in 3.16 First, use peid to check the shell: Nothing is found. Check that the section name has the word themida. The initial
1. Linux Command exit-description of the purpose of exiting the Current Shell
The exit command is used to exit the current shell. In the shell script, you can terminate the execution of the current script. If you do not exit, you may continue to
When installing oralce in Linux, you must first check whether one pair of RPM has been installed. If you check them one by one each time, it will be very troublesome, so a script is simplified.
This script takes only three steps:
1) Save the
Reference: http://feidaodalian.iteye.com/blog/697158It is said that this is an unsolved bug of the SSH Secure Shell client for many years. Both the client and the server must be 'utf-8' encoded.Find information on the Internet and find a simple
Common shells are mainly divided into two major types:
SH:
Burne shell (SH)
Burne again shell (BASH)
CSH:
C shell (CSH)
TC shell (tcsh)
Korn shell (Ksh)
Bash is one of the most successful products in the GNU project. It has been widely used in UNIX
PS1 = '[/[/033 [01; 32 m/]/h:/[/033 [01; 34 m/]/W/[/033 [00 m/]/$'
A brief explanation:The useful information is as follows:PS1 = '[/h:/W]/$'/H display the current host name/W display the current directory/$ Prompt[] For beauty
The result is as
Use a Pseudo Terminal to interact with Shell in Linux
-- Lihn1987
Gdb is always used for program debugging in the company recently. As the debugging level increases, the omnipotent printf becomes increasingly useless. If you can't do it, you will
Chapter 3 shell Input and Output3.1.1 echoThe echo command can display text lines or variables, or input strings to files.Echo [Option] string--E parse escape characters--N: Do not use line breaks. By default, line breaks are used in Linux.-Escape
DeclareOrTypesetBuilt-in commands (they are identical) can be used to restrict attributes of variables. This is a method that is not strictly defined in some programming languages. CommandDeclareIt is only available after bash version 2.
Test File OPERATOR:
-B file: if the file is a special file, it is true.
-C file: if the file is a special character file, it is true.
-D file: if the file is a directory, it is true.
-E file: true if the file exists
-F file: if the file is a normal
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