Basic shell knowledge:
1. Shell Condition Statement, that is, parameters in if:
Http://www.ibm.com/developerworks/cn/linux/shell/bash/bash-2/index.html
2. Many similar programming errors will be removed if all string independent variables
Some solutions to the problems encountered when using shell statements in VB are as follows:
It should be a shell commandProgramAfter the execution is complete, execute the operation to display the file to textbox. Use waitforsingleobject to wait
Problem:
My path is configured, and my peanut shell is logged on!
The forwarding rule is also configured!You can access the network through the domain name in the LAN!However, 3G networks cannot be accessed!
But it can be pinged, but it cannot
Use source, dot (.) when the shell script is executed, no sub-processes are generated. The shell script runs in the current shell, variables declared in shell scripts are visible in the current shell.
When the shell script is directly executed using
Recently, I learned the content of shell script writing and read the script easily. But in fact, there are still some difficulties in hand, so I decided to find some examples to practice, after all, there is a saying that is very good: "I have to
Mycommand> mylog.txt 2> & 1 should be the most classic usage.
Command results can be output in the form of "%>", % indicates the file descriptor: 1 indicates the standard output stdout, and 2 indicates the standard error stderr. The default value of
Collect common skills and notes.Occasionally updated.
1. Shortcut Keys
Terminal shortcut:
CTRL + C: Stop Ctrl + Z: switch to the background Ctrl + D: cancel the current session Ctrl + W: Delete the command parameter Ctrl + u before the cursor:
[-A file] true if the file exists.
[-B file] If the file exists and is a special block file, it is true.
[-C file] If the file exists and is a special word file, it is true.
Device Files: block device files with a single character. The unit of
Common Programming and example of Shell on: http://blog.csdn.net/larrylgq/article/details/7333632
1: ls * | while read FN; do grep-V ', 11,1108, 1133,110816, 110816' $ FN>/data1/hadoop/back_up/tmp/$ {fn} _ 08171819; done
Ls * output
| Media
Hadoop shell command remote submission
I. Principle of hadoop shell command remote submissionHadoop shell command execution is usually performed through Linux Shell in many scenarios. It is also very painful for developers who are used to remote
2.2 quotation marks
1, double quotation marksDouble quotation marks can reference any character except '(reverse quotation marks), $, \2, single quotesSingle quotation marks ignore any referenced values. In other words, if special meanings are
Sometimes, the execution path of the entire shell script file is determined based on the command execution result status.
A simple requirement is to determine whether a row of content exists in a file. If yes, no operation is performed. Otherwise,
The method for listing all Shell objects is not provided below. For more information, see Ishelldispatch: Public idispatch {// you must specify the name of the control panel program. cpl suffix hresult controlpanelitem (BSTR szdir); // causes the
How to extract the line Content Code specified by the file:
If you only want to view the first five lines of the file, you can use the head command,For example: Head-5/etc/passwd
If you want to view the last 10 lines of the file, you can use the
Reprinted statement: This blog article allow free reprint, but reprint need to indicate the author, source: Denny wqf363@hotmail.com Source: www.huntmine.com
Shell-specific variablesTable 14-2 specific s h e l variable $ # number of parameters
This article is also the first chapter of "learning the bash shell" 3rd edition, the Reading Notes of bash basics. But we will not limit this. Bash is used in Linux and has never been systematically studied.
Some I/O operations
Linux I/O has two
Document directory
Syntax of the read command:
Process Input
Original article: Linux Shell scripting tutorial V2.0Syntax of the read command:
read -p "Prompt" variable1 variable2 variableN
-P "prompt": displays the prompt information
1. for I in $ (seq 0 9); do touch file $1; done2. sort-k 1-t ': 'passwd | awk-F': ''{print $3": "$4": "$5 }'3. diff-B file1 file24. isodump-I out. iso-x/media/cdrom; umount/media/cdrom # the usage of cdrom is not considered.5. dd if =/dev/zero of = ~
This morning, I finally got rid of the last question D. My second point is an AK.I still have the copyright to answer this question ~~ More and more interesting!Let's talk about how to do it.I heard that I tried to push the formula myself. It feels
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