Today on the Internet to see a web connection average time of the shell command, in their own machine tried, found that can not use, incredibly appear awk:fatal:division by zero attempted such a mistake, Mao's own changed the shell command.Original
To the users of the Llustrator software to explain the detailed analysis of the design of exquisite shell effect drawing tutorials.
Tutorial Sharing:
Okay, the above information is small make up to you
Sometimes I want to find an IP in my home to test the virtual machine. But do not remember those IP is in use, those who do not use (don't say you remember, OK, I admit I am old), so wrote a shell script to detect, easy to use. Script content:
#
Positional parameters can be moved left with the shift command. For example, shift 3 means that the original $ $ is now $ $, the original $ $ $ $ $ $ $ $ The shift command with no parameters is equal to shift 1.
Very useful UNIX command: shift. We
The shell script is so powerful that it always touches the tip of the iceberg.
Shell recursively traverse directory
#!/bin/bashecho "Please input the directory:"Read CdirFor Dir in $ (find $cdir-type D); Todoecho Change to $dirCD $dirLsecho "------
Today, I saw an article with a shell script and a makefile that would automatically download all of the required packages and compile GCC:
The code is as follows
Copy Code
$ # Download the scripts using wget.$
Script A (test example 1)
The code is as follows
Copy Code
#!/bin/bashEcho ' Your are in the '
Q) Call another script file in the current script file?
Method One: Using source
Script second (test example 2)
Change the contents of the file in each line in the 20140321_files.txt file to Action_begin,Sed-i "s/action/action_begin/g" ' Cat 20140321_files.txt '
Replace the file contents tags in 20140321_files.txt with tags.phpSed-i "s/tags/tags.php/g" ' ls 2
Character: 12345ABCDESplit into:12345ABCDE
Method
echo 12345ABCDE | Awk-f "' {for (i=1;i
echo 12345ABCDE | Sed ' s/./&n/g '
echo 12345ABCDE | Grep-po '. '
echo "12345ABCDE" | Fold-w1
And then
Please 1000! How many 0 are included in the
Here's a simple shell program to illustrate.
debian:~/learn/shell# Cat Phonebook
Alice Chebba 973-555-2015
Barbara Swingle 201-555-9257
Liz Stachiw 212-555-2298
Susan Goldberg 201-555-7776
Susan Topple 212-555-4932
Tony Iannino
In the afternoon, when writing a program, you need to assign the value returned by the shell command to a variable, using the a=$ () method
soft=$ (grep-i "\ Software \) token/passcode/." 123.txt |wc-l)
echo "[+] Soft card total:" $soft
......
The
Objective
Many commands are executed simultaneously during Linux operations or during day-to-day Linux operation, so that it needs to be handled through our multiple command methods. Multi-order execution includes '; ' And the ' && ' command so
In view of debugging Logback and log4j file cutting has been unsuccessful, with the use of shell script to cut the log files under Tomcat (if you have in the Logback or log4j use file cutting success, you can leave the use of the way, first thank
Given A number, shows it in comma-separated form. expects DD and TD to is instantiated. Instantiates Nicenum. Or, if a second arg is specified, the output was echoed to stdout.
Nonsense not much to say that the first is
#!/bin/sh #
The shell case is simpler, but it has its characteristics.
#!/bin/sh
# scriptbc-wrapper for ' BC ' which returns the result of a calculation.
if [$ = ' P ']; Then
precision=$2
shift 2
else
precision=2 # default
fi
bc-q
Script
Script content: java_check.sh
#! /bin/bash
#
If [-Z ' pidof java ']; then
echo-e ' date +%y-%m-%d ' ' Date +%r '. "33[31m33[1m (JAVA) Process does not exist! 33[0m ">>/data/logs/java_check.log
/usr/local/tomcat/bin/startup.sh
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