Shell Scripting compilation

First, replace the text:# #1Sed-i ' s/disabled=true/disabled=false/'/etc/fdfs/storage.conf# #2Sed-i ' s/base_path=\/home\/yuqing\/fastdfs/base_path=\/fdfs\/storage/'/etc/fdfs/storage.conf# #3echo "Enter tracker_ip:"Read Tracker_ipecho "$Tracker

Comparison of Shell variables

Two comparison of parameters[Email protected] shell]# VI test.sh[email protected] shell]# cat test.sh#!/bin/bashif [$1-ge];Then ECHO-E "\033[41;37m \033[0m "Elseecho "Start and End time is: ' Date-d" $ days ago "+%y%m%d"--' date-d ' day Ago

CENTOS 6.6 init Shell script

This script is what you might need to do after you've just installed CENTOS6.6. When learning CentOS, you can run this script to do some configuration to help you not be bothered by these firewall yum SELinux IP.#!/bin/bash  #判断是不是root用户if  [[  "$

Special usage of $0,$?,$! in shell

Variable Description:$$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return value)$-Flag at a glance using the SET command$*All parameter lists. such as "$*" in the

Shell Special variable collation of "Linux"

Catalogue 1. List of special variables 2. Special Instructions In the shell, variable names can only contain numbers, letters, and underscores, because some variables that contain other characters have special meanings, and such

Shell Programming Advanced 1.3data Command

The date command is the command that displays the DateTimeDateFriday, January 01, 2016 15:05:01 CSTThe option to modify the time is-s" 2016-01-01 12:56:10 "View CalendarAa.Annual CalendarCal-yTime to synchronize the serverYum Install Ntp-yNtpdate

Shell handles files that contain spaces in the file name

Recently learning Gradle, using the git clone command to download some information, but the file name contains a space, it does not seem very comfortable, so think of using shell script to batch it, remove the file name of the space, note that this

Lao Li share: "Linux shell Script Raiders" Essentials (ii)

Poptest is the only training institute for developing Test and development engineers in China, aiming at the ability of the trainees to be competent in automated testing, performance testing and testing tools development. If you are interested in

Linux Shell SSH Login Script

Linux Login Server Knock command too much, at some point it is inconvenient, so the shell wrote aI. Description Supports both secret and key formats The user name and password are both written and saved in clear text Two. Configuration

A random choice at noon where to eat the script, no big use ... Skilled in the use of the shell, welcome to vomit Groove ...

Tag:shell    function     menu print     [[email protected] scripts]# cat menu.sh #!/bin/bash################################# ## filename: menu.sh# describe: choose a place to eat# author:  lijun# create date: 2015-09-09# version: 1.0##############

About the role and writing of shell scripts, and the general use of the VI editor for editing help

In Linux, the execution of a script can help us save a lot of time, for the execution of the script it is understood by the individual, it is the same as the beginning of the file #! Bin/bash through the VI editor to create a new executable file,

Linux Shell String Common operations

Take the length of the variable [[Email protected] scripts]# var=oldboy123[[email protected] scripts]# echo  ${var}oldboy123[[email protected] scripts]# echo ${#var}9# For example: #以下判断用read输入一个值, if the length is 0, The value is empty,

Use shell scripts to detect realserver status in LVS and implement automatic removal of attached hosts

#!/bin/sh# Describe:check the real server status# history:2015-08-25 22:21:38# Author:timPath=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binExport PATHvip=192.168.1.121dip=192.168.1.112rip= ("192.168.1.122" "192.168.1.123")Vport=8

Emptying files with shell scripts

Emptying files with shell scriptsIn recent projects, a lot of log files are generated, so you need to write a script to empty them manually, here are a few typical ways.Method 1 Code#!/bin/bash##方法1echo "" > $1echo "$1 cleaned up."RunDescriptionI

Bash shell, call FFmpeg periodic screenshot

#!/bin/bash# gets all m3u8 files in the current directory, and Var=$(ls|grep '. m3u8'|Cut-D'.'-F1) #死循环 while[1=1 ] Do#循环每个文件 forStreaminch$var Do#获取当前最新视频文件 TS=$(ls-t|grep "$stream") for file inch$ts Do#存储M3U8文件文件名作为图片文件名, for* -, capturing

SVN sync to FTP shell script

#! /bin/bashAction () {#1, get SVN update output/OPT/SVN/SVN/BIN/SVN update/opt/lampz/apache/web > File_out#2, gets the number of rows through the output file File_outline=$ (wc-l File_out|awk ' {print $} ')#3, if the number of rows is greater than 2

Shell string interception

There are a number of ways to intercept strings in the shell, ${expression} There are 9 ways to use them. ${parameter:-word}${parameter:=word}${parameter:?word}${parameter:+word} The above 4 alternatives can be used for default values. ${#parameter}

The grep command usage for Shell Scripting Learning notes

grep Basic Usagegrep [Options] [mode] [file:]Options-C outputs only the number of matching rows-I ignore case when searching-H does not display file names when querying multiple files-L searches only for matching file names, not specific matching

What the shell means

Shell: The shell is the most straightforward way to operate Linux, interacting with the Linux system through the input commands in the shell.The shell is a small box, each with a separate namespace, the login operation is a shell (possibly bash,zsh,

Scala VS python2 (Linux or shell) not completed

PS: Only consider the latest version of Scala and python2.x, due to the difference between python3.x and python2.x, and the mainstream of some open source projects are used Python2, currently python2 a little bit compatible python31.

Total Pages: 541 1 .... 377 378 379 380 381 .... 541 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.