Prerequisites
Check script Syntax: Bash-V test. Sh Jack
Do not run. view onlyCode: Bash-n test. Sh
Trace execution: Bash-X test. Sh
Force variables to be declared first and then use: shopt-S-O nounset
When executing the script with SH test. Sh,
Recently, shell has been used. It is very simple and has no logic. I wrote it here just to help myself remember it. It's just a messy note. I hope this will help you. Please advise me more.
1 If else
If [$ #-lt 5]; then
HelpExit 1
Else
Do
Let's take a look at some common shell tips.
CTRL + u Delete the cursor to the beginning of the current row
CTRL + k Delete the cursor position to the end of the current row
CTRL + a move the cursor to the beginning of the current row
CTRL + e
From: http://blog.csdn.net/snrqtdhuqf/article/details/7242309
In shell, there are two ways to assign values to array variables:
(1) name = (value1... valuen) The subscript starts from 0.
(2) name [Index] = Value
Example:
#! /Bin/sh
From: http:// OS .51cto.com/art/200912/165922.htm
Write a script to check whether a file exists. If so, output its details. If not, the system prompts that the output file does not exist. Before providing this script, let's take a look at the
Write a shell script to check whether a process is running
1 #! /Bin/ Sh 2 3 Cmd = Pgrep 4 # Process name 5 Pproc = Test 6 # Loop, to keep the script running for monitoring 7 While : 8 Do 9 If [-N " '$ Cmd $ pproc' " ] 10
Eclipse on Mac often needs to manually close the Java Process, which is a little troublesome. Write a simple shell in. bash_profile and use the port number to close the process.Lsof-Ti: 9001.Then $ source. bash_profile can use the killps command.
Passing parameters to triggers in Javascript using the shell packaging method
Reference address: http://callof.net/Site/pView.Asp? Id = 1270
In a well-structured web page, not only must the
Do you know about Linux? Are you an application of Linux? If you want to learn about Linux, you may encounter the problem of automatic Linux Shell interaction. Here we will introduce how to solve the problem of automatic Linux Shell interaction.
Folder, Start Menu folder, and personal document folder.
SyntaxWshshell. specialfolders = obw.shspecialfolders
Example'This code fragment shows how to access the Desktop FolderSet wshshell = wscript. Createobject ("wscript. Shell ")Msgbox "your
Do not add the parameter-V. Otherwise, you will test it on Linux.
VI autoftp. Sh
The content is as follows:
FTP-n-v-I
Linux Command (used to set file permissions) umask
022
The preceding command indicates that the umask value in Linux is 022.
SELF: http://lulu87.blog.51cto.com/1244696/373771
Case 1: use shell scripts for System Management
Lab Environment
The company is equipped with a Linux server for technical training at the Branch Office. Therefore, you need to add user accounts
This is my usual work desktop. Or this is the Emacs I usually work on.
To see the big picture, click here
The above figure shows a 4-window working mode that many people like very much. This mode is widely used by shell users. I once liked this
Kill-ring is definitely a wonderful design in Emacs. Many times I hate to add the clipboard of X WindowKill-ring. However, when I enter M-yThere will always be a lot of boring things in it. I may never post those things, because they are not
Author: gnuhpcSource: http://www.cnblogs.com/gnuhpc/
Color is selected by adding a special sequence-basically a numerical value between "/E [" and "m. If more than one numeric code is specified, separate them with semicolons.Echo-e "/E [31; 40 m"The
Shell Command learning notes
1. tr replacement characters
Simple Example: tr 'A' a'
Replace A with. The tr command can only be used to replace a single character. If it is written:
Tr 'abc'
It means to replace the characters A, B, and C with the
Redirection
File Code: 0, 1, 2 ,... output
Most of the conversion semantics cannot be used independently and must be used together with the Bash command.
Operation file:
Fd <> FileFd file code, available for reading and writing
Fd Close input
Recently, I am working on a project, because some functions are implemented using ORACLE package, but it is very good to use UNIX scripts, therefore, an executable host request is mounted on the AP to solve this problem.
I think this is a little
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