Detailed description View:(a) Play with Me Linux network services: DNS service--bind (/etc/named.conf,/var/named) settings implementation and interpretation1#! /bin/Bash2ip="10.10.10"3rip="10.10.10"4dn="gr.org"5Name="10.10.10.10"6 7Cat
Subtracts the specified day from the specified date[Email protected] init_env]$ date-d "20150416 3 days" + "%y%m%d%h"2015041912Adds the specified hour to the specified date[Email protected] init_env]$ date-d "20150416 3 hour" +
first, the initial knowledge of the scriptShell: A class of interpreter between the system kernel and the user.Scripts: A class of files that are executed in a preset order using a specific languagebatch, macro, and interpreter programsTo create a
1. What is bash?Bash is a Unix shell written for the GNU program and is the default shell used by many Linux platforms.The shell is a command interpreter, an insulating layer between the operating system kernel and the user. At the same time, the
First, Grep,egrep,fgrep1) grepFormat: grep [options] [mode] [file name]Common options:-N: Display line numbers and matching rows-V: Reverse match-C: No matching rows are displayed, only the number of matching rows is displayed-I: Ignore case-R:
"Shell Script Basics"Create a script#vim 1.sh*********************#! /bin/bashecho "Hello world!"*********************#chmod +x 1.sh#sh 1.shHello world!Extensions and command extensions still work within double quotation marks.#echo "Can I have a
1. The script determines whether the command output is empty(1) Determine if the string is emptyIf ["$str" = ""]If [x "$str" = x]If [-Z ' $str '] (-n is not null)Note: You have to double quotation marks, or some commands will be error, form a good
#!/bin/bashwhile ifs=: Read name1 name2 name3 name4#ifs is the split symbol specified when reading from a file, assigning the contents of a to the corresponding variable in separate sections. Do echo $name 1 ' | ' $name 2 ' | ' $name 3 ' | ' $name 4
PS: Red font is an important part, look carefullyFirst, Shell features1. History view the command record, default records 1000;[Email protected] ~]# history 1 vim/etc/hosts 2 Ifconfig 3 cd/etc/sysconfig/network-scripts/ifcfg-4
(EXPRESSION)Expression is true expression true! EXPRESSIONExpression is false expression falseExpression1-a EXPRESSION2Both EXPRESSION1 and EXPRESSION2 are true both trueExpression1-o EXPRESSION2Either EXPRESSION1 or EXPRESSION2 is true one of
The shell, as a scripting language, is a skill that every Linux administrator must master, sometimes adding some background color to the output in the shell, making the script a little more aesthetically pleasing, and using echo to output a string,
A simple paragraph was written in the shell.Energy.sh content:#!/bin/Bashhost=127.0.0.1User=******passwd=******dbname=******TableName=Device_value_300sct007p01_yearmonth=$(Date+%y-%m) sqlstr="INSERT INTO Device_value_300sct007p01_year (id,year,month,
Position parameters can be usedshiftcommand to move left. Like whatshift 3Indicates that the original$4Now become$1, the original$5Now become$2Wait, the original.$1、$2、$3Discarded$0Do not move. With no parameters.shiftcommand is equivalent toshift 1。
First, write a script, let the user input: 1.first name 2.last name, last displayed on the screen: Your full name is: Content#!/bin/bashread-p "Please input your firstname:" firstnameread-p "Please input your lastname:" LASTNAMEECHO-E "your ful L
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
Shell script sorting (Bubble Sorting), shell script sorting bubble
#/Bin/basha = (9 84 51 0 345 1 2 34 1 0) # define an array temp = for (I = 0; I
The above is sorted by a custom fixed array, and the following is a user-defined input array.
Test and content replacement of shell variables, replacement of shell Variables
Reference: laruence's private house dish-Linux BASICS (Third edition).
In Chapter 11th of the Linux BASICS (Third edition, the final example illustrates '-', '=', and '
Execute the system command and write the shell script that writes the output to the log file,
This is probably the requirement. Run the usysfault command on the aix system to retrieve the fault light information. However, it seems that only 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service