Create a fileYou will always encounter situations where empty files are created. Sometimes the application wants a log file to exist before they can write the data. At this point, you can easily create an empty file using the Touch command.Touch
Progress bar in the future development, testing, operation and maintenance, can be automated inspection project updates, operation and so on, greatly accelerate the efficiency of work.1. Code implementation 1 #!/bin/bash 2 function proc () 3 { 4
Using a shell script to implement a progress barThe code is as follows:650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/82/DC/wKiom1dirnXDvyV1AAA-ATqC6Jg995.png-wh_500x0-wm_3 -wmp_4-s_4061727919.png "title=" progress bar. PNG "alt="
There are 3 ways to execute the shell script:
Bash xxxxx.sh or SH xxxxx.sh (recommended)
Path/xxxxx.sh or./xxxxx.sh (Execute script under current path)
SOURCE xxxxx.sh or. Xxxxx.sh (there is a space behind the dot.) This way you can put
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/82/E0/wKioL1djmxjx5LUrAACG8N3z-pA754.png "style=" float: none; "title=" 0.png "alt=" Wkiol1djmxjx5luraacg8n3z-pa754.png "/>The maximum, minimum, and average values of a set of numbers are
To achieve ping a network segment of all the IP, and detect the network connection status is normal, many methods can be implemented, the following is a brief introduction of two, as follows:Script 1#!/bin/sh# Ping Network segment all IPs# 2012/02/05
1 #!/bin/bash23 str= "Http://www.baidu.com/test.htm"45 #echo ${str}The result of the operation is:http://www.baidu.com/test.htmMethod One: #截取, delete the left character, leave the right characterEcho ${str#*//}#*//means to delete the first//number
Michael Stutz, author of the Linux Cookbook, has summed up 10 good habits with his many years of experience in using UNIX, and personally believes that it is really useful, and is summarized below to share with you.1. Create a hierarchy directory:
I. Concept:The shell, commonly known as the shell (used to distinguish it from the kernel), is a command-line interpreter that receives user commands and then invokes the appropriate application.
Two. Type of shell:1. SH (Bourne Shell):
*-----Wildcard (multi-bit)?-----wildcard character (one bit)#-----Comment (Explanatory Note)\-----caret (\ #1. txt, let #1.txt become a file name, so that the special symbol behind the loss of meaning)|-----Give the result of one command to another
Tag: TR WC split cutCut interceptCut-d:-f+ number + file to take the first paragraph of the file, with a comma between multiple numbersCut-c intercept the first few characters (3-5 3 to 5)Sort sorts-T delimiter-U to repeat-N Sort by number-K
#!/bin/bashName="Matto" #变量名和等号之间不能有空格 #name="Blog4matto" #重定义name变量 #readonly name #设置name为只读变量 # unset name #删除变量, you cannot delete a read-only variable #${name}
Requirements: Read IP addresses and port numbers from a file, open the IP and ports with Iptablessuch as file content:[email protected] huwei]# cat ip.txt192.168.66.20 22192.168.66.30 10050192.168.66.30 33The manual action is:[[email protected]
I. Shell BasicsCat/etc/shells the shell that the current operating system can useWhat is a shell?A text file that implements a function that has permission to executeCommand-line InterpreterBuilt-in commands (commands provided internally by the
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.