#!/bin/bashwhile true; do for i in {100..120};d o ping -c 2 -w 2 192.168.0. $I &>/dev/null if [ $? -eq 0 ];then echo -e "\033[32;40m 192.168.0. $I is up.\033[0m " else echo -e "\033[32;40m 192.168.0. $I is down.\033[0m"
8.1 Shell introduces a simple point of understanding, is the system with the computer hardware to use intermediate media, it is only a tool of the system. In fact, there is a layer of stuff between the shell and the computer hardware that is the
Sometimes you need to simply deal with the file, with a few lines of shell script statements can be done, convenient, here to remember, while the next use. Combined with other people's blog and their own practice, but also the original
A recent need to do a real-time statistical network situation and statistics of the error rate of the script, the following is a stackexchange on the plagiarism, although not fully satisfied, but only can output some information#!/bin/Bashhost=$1if[-
Today the weather is cloudy, a little bored, so boring to play like ...#!/bin/bash#date:2017-6-20#version:1.0#author:xcn ([email protected]) menu () {Cat This article is from the "Little Rookie" blog, please be sure to keep this source
Positional variables
$ $ Gets the file name of the currently executing shell script, including the script path if the script is executed with a path[[Email protected] shell]# sh n.sh n.sh[[email protected] ~]# sh/shell/n.sh/shell/n.sh[[email
& placed after the startup parameter to set this process as a background processBy default, the process is the foreground process, then the shell is occupied, we can not do other operations, for those who do not interact with the process, many times,
Create the user who wrote the file650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/98/E0/wKiom1lBR5_gYB4HAAAoKuZARYU671.png "title=" Screenshot from 2017-06-13 19-44-27.png "alt=" Wkiom1lbr5_gyb4haaaokuzaryu671.png "/>Second, ping 172.25.2
Shell Script Rollup 2 delete files that have been created for more than 32 days#!/bin/bash#date:2017-04-11#version:clear_ballcloud_back_v1.0#contents: removing the /www /web/ballcloud_bakck/* , if the file is created above 32 day#cd
0--stdin Standard input1--stdout Standard Output2--stderr standard Errorredirectecho "This was a good idea" > Temp.txtTemp.txt content will be emptied first before entering "this is a good idea"Additionalecho "This was a bad idea" >> temp.txtCat
grep: For fuzzy lookups, in standard input or file Format: grep [option parameter] ... PATTERN | FILE ...Option parameter Description:- E,--extended-regexp PATTERN is an extensible regular expression-E,--regexp=pattern using PATTERN for matching
Shell scripts can be directly./**.sh, or bash **.shI use the./**.sh to run a script of my own, and the following error will appear:[Email protected]:~$./pixel. SH bash:. /pixel. SH : Insufficient permissions [email protected]: sudo ./pixel. SH
This article mainly introduces the 4 methods of executing shell scripts in Linux, that is, 4 ways to run shell scripts in Linux, and the friends you need can refer to the followingThere are several ways to bash a shell script, and now make a summary.
The folder does not exist and is createdif [!-d "/data/"];thenmkdir/dataelseecho "folder already exists" fiFile exists then deleteif [!-F "/data/filename"];thenecho "file does not exist" Elserm-rf/data/filenamefiDetermine if a folder existsIf [-d
$ $1-n The name of the current shell script the position variable $ #参数的数量 $* the value of all positional variables #? To determine whether the previous command succeeded, 0 for success, The non-0 is the failure---------------------------------------
Tag: Shell expression exists * * * Specify dir DIA statement return resultIf condition statement: The IF condition statement is divided into single branch structure, double branch structure, Multi-branch Structure-------------------------------------
Shell Application TipsThe shell is a command interpreter, a layer of interaction between the kernel and the kernel. There are many kinds of shells, the one with the prompt that belongs to /bin/bash, and almost all Linux Systems default to this shell.
#声明脚本#!/bin/bash#打印 "------CFB---------"echo "------CFB---------"#java环境变量Java_home=/usr/java/jdk1.8.0_11Classpath= $JAVA _home/bin#指定需要执行jar包的位置, you can set your ownJarpath=/home/haha/desktop#环境变量的标准格式Classpath= $CLASSPATH:
Multiple values can be stored in an array. The Bash Shell supports only one-dimensional arrays (which do not support multidimensional arrays) and does not need to define the array size when initializing (similar to PHP).Like most programming
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