It's recorded in a shell script.. ./file.sh and/file.sh the difference, this article refers to the http://www.lslnet.com/linux/dosc1/39/linux-283534.htm (this blue forest thing should be derived from Chinaunix)A little experiment.Scenario One:VI
Below is the output information of my wlan0 NIC, you can use Ifconfig or Ifconfig | Sed-n '/wlan0/,10p ' gets the format of the displayed informationwlan0 Link encap:ethernet hwaddr xx:xx:xx:xx:xx:xx inet addr:172.29.164.251 bcast:
This article turns from: http://www.jb51.net/article/56548.htm This article mainly describes how many parameters the shell supports? This article is a test article on how many parameters a shell can enter, and the friend you need can refer to the
After the user logs on to Linux, a system prompt symbol appears, which allows you to enter a lot of commands after the symbol and get the desired effect, who is behind the scenes who is helping us with this whole pile of things? is the shell, and
Ls-lat list all the stuff in the current directoryLs-lath people look at the sizeLs-f | grep "/$" only DirectoryLS-LR include subdirectories ...LS--ignore filename-lt ignores a Which, in the path specified by the path variable, searches to see if a
1. #注释作用, #! Except in addition, in the parameter replacement echo ${path#*:} here does not represent the comment, the numeral conversion, does not represent the comment echo $ ((2#101011)) 2. Command line delimiter, you can write multiple commands
1. Practice Yourself#!/bin/basha=0while:d o a= ' expr $a + 1 ' if [$a-lt 4]then echo-n-E "input number 1 to 9 \ n" read Num case $Num in 1|2|3|4|5|6 |7|8| 9) Echo-e "You are number is: $Num!" ;; *) echo "R error number, game over!" break;;
Tag:shell reference escape command replace Escape and reference two types of characters: normal character and escape character escaping: "\" Example: 1, Echo $Dollar 2, echo \ $Dollar 3, Ech O? Characters that need to be
Example one;Touch test.shVI test.shInputTest= ' echo ' test* "|grep [a-za-z0-9] |wc-c 'Echo $testSave, Exit VI;SH test.shResult: Echo "test*" |grep [a-za-z0-9] |wc-cDescription not implemented;We modify a pair of single quotes to $ () and the result
REDIRECT concept: Change the default input and output to another input/output file identifier Linux uses 0-9 to indicate the data flow associated with a particular process, and the system will open three files for that process when it starts a
One, for loop The For loop works by taking the serial element one by one out, putting it into the specified variable sequentially, and repeating the contained command area (between do and done) until all the elements takeUntil the end. Where serial
From the programmer's point of view, the shell itself is a program written in C language, from the user's point of view, the shell is the user and the Linux operating system communication Bridge. The user can either enter command execution or use
1. Running a program with parameters$ A indicates the name of the program, which represents the first argument, and the second argument, and so on, until the nineth parameter $9# VI Factorial#!/bin/shf=1for ((i=1;iTest:[Email protected]
A. Character test= =: Test for equality, equality is true, not equal to False! =: Test Whether it is unequal, not equal to true, etc as false>-N String: Tests whether the specified string is empty, empty is true, or false-Z String: Tests whether the
Sometimes to share a tool with others, but also need to provide more documents;If sharing a compressed package also have to teach each other how to extract, execute which script, feel the need to transfer more content is inconvenient;A few shell
· CMD in the execution of the shell regardless of · What is the content of, advanced interpretation, and then the interpretation of the final results to the shell, if the result of interpretation is not the shell can command, will be error. However,
1, the variables in the shell can be customized, the shell uses the variable with the $Name= "Shero"echo "Hi ${name}"[Email protected]:/home/shero/shell#./test2.shHi SheroNote that there can be no spaces between the variable name and the equals sign,
Http://www.cnblogs.com/chengmo/archive/2010/09/30/1839632.html#!/bin/The bash# script detects an offline host opportunity to send an email notification that can be run all the time. # Please set mail gatewany IP lastip Four items according to your
Linux series-shell learning notes (Continued 1) process user input,-shell learning notes
1. Run the program with Parameters
$0 indicates the program name, $1 indicates the first parameter, $2 indicates the second parameter, and so on until the ninth
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.