Convert the 0024.b20b.693f address into a 00:24:b2:0b:69:3f1. Dot-delimited[Email protected] ~]# echo "0024.b20b.693f" | Sed-r ' s/\b (..) (..) \b/\1:\2/g;s/\./:/g '00:24:b2:0b:69:3f2. If the colon is separated, convert the 0024:b20b:693f to 00:24:b2
1. basename is the name left after the directory is removed .example:shell>temp=/home/temp/1.testshell>base= ' basename $temp 'Shell>echo $baseThe result is: 1.test2. dirname is to fetch directory example:shell>temp=/home/temp/1.testshell>dir= '
The following are some of the more commonly used command line or shell scripts that are extracted during the deployment of OpenStack, for informational purposes only.1. Kill all existing zombie processesPs-ef | grep Defunc | Grep-v grep | awk '
Here is a summary of some of the recent learning Shell script knowledge pointsBlog Park-Bang Bang sauce Good * * *1. IntroductionThe shell is a text interface that lets us communicate with the system. The shell script is the one written for the
1-echo ' Date ' +%y-%m-%d%h:%m:%s "'2014-11-13 15:06:262-echo ' Date ' +%y-%m-%d%h:%m:%s "'14-11-13 15:06:51Note: "+%y-%m-%d%h:%m:%s" caseThe given format controls the output, and the sequence is interpreted as follows:Percent of a text%%a of the
A Tetris that was written on the web with a Linux shell script. It's the best shell I've ever seen written. Share a bit.The original author information is in the comments of the script.#!/bin/bash # Tetris game# 10.21.2003 xhchen #APP declarationAPP_
One, for loop[email protected] shell]# cat for.sh#!/bin/bashFor i in ' seq 1 10 '; Doecho "$i"DoneWith this script you can see the basic structure of the For loop:The condition of the for variable name in the loop; do Commanddone[Email protected]
The previous period of time to maintain the server, need to install the LNMP environment, so I tidied up a bit, as a script, recorded.#!/bin/sh#copyright (c) 2010-2015 redapple ([email protected]) #install lnmp # version 0.1.1#date 20140813#------
Format: "\033[display mode; front color; background color m string \033[0m"\033: Starting an escape sequence[: Start Color definitionThere are several ways to display the method:0 Terminal default settings1 高亮显示4 使用下划线5
Getting Started with Shell programmingOne, variable assignment and arithmetic operationExample code:A=1echo $alet b= $a +1echo $bc =$[a+b]echo $cd =$[c*2]echo $dlet e=d*2echo $ef =$[e%5]echo $fNote the "=" number must not have spaces on either
In another blog "shell script implementation DB2 database table export to file " implemented through the implementation of the script to export the DB2 database to a file, need to pass in seven parameters, the last is a string with a space, so when
In the shell, arguments can be passed to a function when it is called. Inside the function body, the value of the parameter is obtained in the form of a $n, for example, $ $ for the first argument, and $ = for the second argument ...Examples of
Recently due to data migration, some user information needs to be re-confirmed, perhaps a large amount of data, but the need for the final confirmation of such as the user ID and its corresponding number of user points, which will lead to the
No wget first download get command yum-y install wget1. Download Peanut shells[Email protected] ~]# wget http://download.oray.com/peanuthull/linux/phddns-2.0.6.x86_64.tar.gz2. Unzip the tar.gz[Email protected] ~]# tar zxvf
Shell obtains the gateway and modifies the IP address to enable the NIC.
#! /Bin/bash # autho freefei # script is a init computer ETH # data 2014 10 09 192.168.1.1netstats =$ (netstat-r | grep default | cut-f 10-d ''); echo $ netstats; # change
Shell script to replace the tomcat cluster war package
Run the command to log on to the server without ssh.
The configuration file does not change much to overwrite the previous configuration.
Profile configuration file
Bak =/home/wsm/bakWebapps
The Shell script calls the specified function by passing parameters. The shell script
When writing some functional scripts, we usually put functions with similar operations or similar parameters in the same shell script, which is convenient to
Use shell commands to analyze statistics logs and shell commands to collect statistics logs
When you need to collect user log information and analyze user behavior, you can use shell to conveniently retrieve a lot of data and place it in excel for
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