In the GNOME desktop environment of RedHat Enterprise linux4, gnome-terminal is used by default.
ProgramIn, sometimes Shell needs to be called for execution. At this time, we need to start gnome-terminal. How to run the program is actually very
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
If the variable is null, you can use: = to set a default value. Syntax:
$ {Var: = defaultvalue}
Example:
Enter the following command in terminal:
Jubincn @ Ubuntu :~ $ Echo $ {Bank: = ICBC} icbcjubincn @ Ubuntu :~ $ Echo bankicbcjubincn @
Address: http://blog.csdn.net/gtuu0123/article/details/6013741
(1) substr in awkSubstr (source string, start index, length) Start index starts with 0Example:Awk '{$ A = substr ($, 2); print $ A;}' filenameAssume that only one row in the file is
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
Reading the Linux Shell written by othersCodeSuddenly found a lot of code similar to the following format:
["$ Pro" = "1"] & ckssl = "-- SSL" [-n "$ IP"] & ckip = "-h $ IP" [-n" $ port "] & ckport ="-p $ port"
I didn't understand why I wrote
1. For and if commands containing [] must be separated by spaces.
2. Calculation and Assignment Methods
Var = 1 (Note: Bash/pdksh cannot leave spaces on both sides of the equal sign)
First: (VAR ++ ))
Type 2: var =$ ($ var + 1 ))
3.
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
Example
Ls-L> out. File 2> & 1 &
Explanation:Ls-L> out. File // redirects ls output to file out. File
2> & 1 // in shell, the file descriptor is usually stdin, stdout, stderr, I .e., 0, 1, 2. It can be seen that it uses LS-L> out. the error
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,
This article is the Second Reading Note of Flow Control in Chapter 5 of Learning the bash Shell 3rd Edition, but we will not limit it to this. Flow control is a common part of any programming language and includes bash. Here, we will continue to
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
I. Shell VariablesIt mainly includes local variables and environment variables.
1. Local variable -- Used in the script currently running by the user1)Define local variablesFormat: variable-name = valueExample: [root @ jike1/root] # LOCALTEST =
Before giving you a detailed introduction to linux compilation, let's first understand the Linux script Shell command. The following explains how to use arbitrary unix commands in shell scripts.
Basic syntax Introduction
1. Start
The program must
From: http://www.lampchina.net/article/htmls/200903/MjE4Njk1.html
Function of quotation marks
1Double quotation marks ("")
1) Use""Referable except characters$ (Dollar sign),`(Reverse quotation marks ),/Any character or string outside
Assume that a rails program is started:Ruby script/ServerThis is usually the case:Nohup Ruby script/Server &The error output stream is also directed to the normal output stream:Nohup Ruby script/Server & 2> 1 &
To record the PID:Nohup Ruby
This problem is related to the shell Interface Programming part. When a complicated problem occurs, no matter which part of the folder is operated, the Operation should start from the root node (Desktop) of the shell file system, until you find the
The basic structure of until is:
Until [condition]; do
Logic
Done
The code I implemented is as follows:
Sum = 0; n = 3; in = 0;Until ["$ n" = 0]; doRead inSum = 'expr $ sum + $ in'N = 'expr $ n-1'DoneEcho $ sum
The basic structure of a for loop
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