The I-III section deals only with bash ...
For others, see section IV ... I: The use of obase, IBase and BC: IBase is the input of numbers, and obase is the output of the number of the system. Well remember, I am input,o is output.Note that the F
In the shell script, when comparing with parameters, such as "[$temp-eq" IPhone "]", there may be an "integer expression expected" error. This is because these parameters:-GT,-lt,-eq comparisons are both numbers and variables, so the variable temp
$: The name of the executing script $* and $@: Return all parameters to $#: The number of arguments $_: represents the last parameter of the previous command $$: The PID $! that represents the command that was last executed: The PID $?: A flag that
1. Definition of variables
1.1 Variable names can consist of letters, numbers, underscores, but numbers cannot be the first character of a variable name.
1.2 Define the value of the variable by assigning the symbol "=", e.g:
Myname= ' Test ', String
1, write script/root/bin/systeminfo.sh, display the current host system information, including hostname, IPV4 address, operating system version, kernel version, CPU model, memory size, hard disk size2, scripting/root/bin/backup.sh, can be
This note is based on the built-in shellcontrol of Delphi 7Source codeAnalysis, read a lot of MFC implementation class Explorer Shell controls, BCG, cjlib, but do not have Delphi shell control perfect, for example, tshelllistview can automatically
It is for entertainment only and is not responsible for the result of misoperations.
1. Remote copyRoot@192.168.1.38:/f/u/C/k.txt.Root@192.168.1.38 SCP-r-p1234:/beauty.
2. Force Overwrite\ CP-r/data/data1
3. synchronous copy of
I am used to the C/C ++ programming environment, and then switched to shell programming, there is always a strange feeling.
The general if-then-else Function Format in shell is as follows:
If condition 1
Then command 1
Elif condition 2
Linux Shell Programming
In fact, the interactive interpretation and execution of user input commands as a command language is only one aspect of the shell function, shell can also be used for program design, it provides a variety of methods to
Hill sorting was named by computer scientist Donald L. Shell. He discovered the hill Sorting Algorithm in 1959. Hill sorting is based on insert sorting, but a new feature is added, which greatly improves the execution efficiency of insert
F statement format
If conditionThenCommandElseCommandFi, don't forget the end.
If statements forget the final fiTest. sh: line 14: syntax error: unexpected end of fi
Three conditional expressions of if
Shell:
Shell Baidu Encyclopedia: Baidu. It receives user commands and calls corresponding applications. It is also a programming language. As a command language, it interactively interprets and executes user-entered commands or automatically
Introduction: for some programs that need to run for a long time (such as server programs), it is necessary to write a monitoring program to enable automatic restart upon unexpected exit. This function can be implemented through a simple shell
First, let's talk about the basic idea of shell sorting: First take an integer D1 less than N as the first increment, and divide all the records of the file into D1 groups. All records whose distance is a multiple of DL are placed in the same group.
A simple example:
#!/bin/bashecho "What's your favourite star?"select var in "Leehom" "Vae" "Jay" "Jolin"; dobreak;doneecho "You have selected $var"
Running result:
root@ubuntu:~# ./star.shWhat's your favourite star?1) Leehom2) Vae3) Jay4) Jolin#
Find out the difference between for and while, and write out the memo.
Script:
File =/home/hadoop/phrases.txt for content in 'cat $ {file} 'Do phrase = 'echo $ {content}' echo $ phrasedone
The phrases.txt file contains the following content:
#!/bin/sh#for exm to test# ./check.sh 12 36 25 12 453 1 2 3 RETVAL=0SRRVER_START=1SRRVER_STOP=2DNS_STATUS=1dnsCheck(){ while test "x`pidof dnsmasq`" != x ; do echo "check DNS status...................."
1. Bash script parameter Processing
Bash parameters can be accessed by adding a numerical number to $, where:
$ # Indicates the number of Script Parameters
$1 indicates the script's 1st parameters.
$2 represents the 2nd parameters of the
Document directory
1. Use of shell Array
2. awk Array Operations
3. shell parameter problems
4. How to output single quotes in awk
5. Methods for connecting awk and shell strings
1. Use of shell Array
Value assignment: All = (6 5 4 3 1 8 9 10)
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