http://blog.csdn.net/gyanp/article/details/79030561) Format adjustment has the following parametersSet echo on/off displays the commands that need to be executed in the scriptSet feedback on/off indicates how many rows are returned after the select
(i) SEDSed is a streamlined, non-interactive, streaming editor that enters edit commands and specifies file names on the command line, and then looks at the output on the screen.The content of a progressive read file is stored in a temporary buffer
Brief description:Prompts the user to enter two numbers;Determine whether the input content is a number;Numbers do calculations and feedback results;When the calculation is complete, ask the customer whether to continue using;Provides a way for
1) How do I pass parameters to a script?./script argumentExample : Show file name script./show.sh File1.txtcat Show.sh#!/bin/bashcat $2) How do I use parameters in a script?First parameter: $ $, second argument: $ AExample: The script will copy the
One, for commandIn shell programming, sometimes we need to repeat the command until a certain condition is reached, and the bash shell provides a for command that allows you to create a loop that iterates through a series of values, each of which
The Binlog log is as follows:/*!50530 SET @ @SESSION. pseudo_slave_mode=1*/;/*!40019 SET @ @session. max_insert_delayed_threads=0*/;/*!50003 SET @[email protected] @COMPLETION_TYPE, completion_type=0*/;DELIMITER/*!*/;# at 120#160111 16:37:29 Server
Suppose we define a variable as:File=/dir1/dir2/dir3/my.file.txtDifferent values can be replaced with ${}, respectively:${file#*/}: Delete the first/its left string: dir1/dir2/dir3/my.file.txt${file##*/}: Remove the last/and left string: my.file.txt$
Prompt effect: Code: # sexy solarized bash prompt, inspired by "Extravagant Zsh Prompt "# customized for the solarized color scheme by sean o ' Neilif tput setaf 1 &> /dev/null; then if [[ $ (tput colors) -ge 256 ]] 2>/dev/null; then
Digital time Transfer Standard Time:Digital time such as: 20151009163000Standard Time: 2015-10-19-16:30:00A= ' head-1/home/xxx/xxx/bin/.status |awk-f= ' {print $ {} ' |sed-r ' s/([0-9]{4}) ([0-9]{2}) ([0-9]{2}) ([0-9]{2}) ([}) ([0-9]{2}] ) ([0-9]{2})
Path to the LS Etc/init.d/shell scriptls/usr/local/apache2/Ls/usr/local/apache2/bin/apachectl1. Shell FeaturesOrder history!! !$!n! characterTab key to complete file path or commandAlias a= "B" Unalias AWildcard * Matches 0 or more characters? Match
Writing the first shell scriptLike other languages, we use any kind of text editor, such as Nedit, Kedit, emacs, vi, etc. to write our shell program. The program must start with the following line (must be in the first line of the file):#!/bin/shThe
First, the Loop statement forloop control statements in Bash :for,while,untilFor loop Syntax 1:For variable name in list;Loop bodyDoneOperating features:First pass: Assigns the first element in the list the variable name definition, then executes
Original:
Http://www.javacodegeeks.com/2013/10/shell-scripting-best-practices.html#BP11
Translation:
Aven
Most programming languages have a series of codes that use this language to follow good programming
If you want to start a shell script in a terminal session, and then have the script run in background mode until it finishes, you can use the Nohup command, even if you quit the terminal session. The feeling of Nohup is to initialize a process to a
When using Hudson's execute SH script, if the SH script is a background process, such as TOMCAT services. If you use the default configuration of Hudson, you will find that the SH process has a start-up process, but will not be resident in the
1Pre-work: source code for Apache installation. The installation directory is/usr/local/httpd2 3 Mission Requirements:4 1, available through service httpd start|stop|status|Restart command to control a service5 6 2, httpd service can boot from start7
Personally wrote the shell script only to find that this thing is very convenient, when you want to put some trivial, detailed small instructions to complete a single time, the script is undoubtedly the best choice, convenient, fast, the key is
Shell Programming Simple TutorialI can't say how many complex shell scripts I've written, but some simple scripts write a lot. Working under Linux, sometimes bits and pieces of work, if you write a shell script to deal with, you will find that it is
Resources:Shell String Split recycle: http://www.shangxueba.com/jingyan/1633455.htmlDescription of the If else and greater than, less than, equal to logical expressions in the Linux shell: http://www.jb51.net/article/34332.htmShell array: Definition
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.