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
Transfer
1. location parametersThe parameters provided by the system are called location parameters. The value of the location parameter can be obtained using $ N. N is a number. If it is 1, it is $1. It is similar to the number in C language.In
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
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
Instance
General programming steps
Now let's discuss the general steps for writing a script. Any excellent script should have help and input parameters. And write a pseudo script (framework. sh) that contains the framework structure required by
This article is the seventh chapter of "Learning the bash Shell" 3rd Edition, "Input/Output and Command-Line Processing.
Echo
Echo is a very common shell command. The parameters are as follows:
-E: parses backslash-escaped, a backslash (/n),/t,
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
Use the dbms_pipe package and create a daemon running on the OS
I think this method is complicated. I still need to use Pro * C. I didn't try it. Here is an example.
Use Java's getruntime(cmd.exe C
Java uses a lot of such advantages.
1) write a
Simple shell script encapsulation for wget
Article: http://blog.csdn.net/5iasp/article/details/8862303
Author: javaboy2012Email: yanek@163.comQq: 1046011462
Purpose: capture a url and save it to a specified file in the specified directory.
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
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 = ~
From: http://blog.sina.com.cn/s/blog_7556be720100ryp2.html
CTRL + P repeat the previous command
CTRL + a jump to the first characterCTRL + x same as above, but once again, it will return to the original locationCTRL + B move one character forward
Because the parameters following the kill command in the adb shell are pid, ps all applications first:Adb is in shell
Root @ android:/# ps
USER PID PPID VSIZE RSS WCHAN PC NAMERoot 1 0 676 528 c0159a18 000102f4 S/initRoot 2 0 0 0 c00741c8 00000000 S
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
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
In Linux, It is very troublesome to use ruijie. After installing myxrgsu, you must enter your account and password every time you use it. This process is too cumbersome. So I want to find a way to automatically enter the password and other
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.