A special character that summarizes the shell script 28

1. #annotation function, #! ExceptIn addition, in the parameter replacement echo ${path#*:} here does not represent a comment, a numbering conversion, does not represent a comment echo $ ((2#101011))2.;Command line separator, you can write multiple

Nginx Log Analysis shell script in Linux

When using a virtual host before, look at the Web site run log, found a lot of abnormal malicious access. At that time because they do not have the system permissions can not be able to screen these actions. Now have their own cloud host, front-end

Using Shell to implement batch transform file encoding in Linux

Principle and simplicity: recursion, iconv   code is as follows copy code #!/bin/sh tgt= "Source_rst" Function Fe_convert () {      for file in ' ls $ '     do         if [-D $/' $fi Le]         then        

Shell implementation Arithmetic Simple method

When you just learned to write shell batches, there is no need to base your logic operations on the basics: arithmetic, here's a simple implementation method in the Linux shell.1. Simple method$ b=$ ((5*5+5-3/2))$ echo $b29In the Linux shell, we can

echo Display content color in shell script

echo Display in shell script with color display, echo display with color, need to use parameter-EThe format is as follows:For example:Where 41 of the position represents the background, 36 of the position is the color of the wordNote:1, the word

Connectors in the shell (and, and, or)

&& and|| Or# when two files are present[[email protected] ~]# ls 1.txt && ls 2.txt1.txt2.txt# 10.txt file does not exist[[email protected] ~]# ls 10.txt && ls 2.txtLS: Unable to access 10.txt: No file or directory[[email protected] ~]# ls 10.txt | |

Use the git shell command-line mode to operate with GitHub

First, log in to Git and create a new repositorySecond, in the "Repository name" column to fill in the name of the version of the warehouse, such as "test", description column is a description, can be filled.The default access is public, click the

Understand a dialect in the Linux Shell: 2>&1

Understand a dialect in the Linux Shell: 2>&12016-11-14 Du Yishu ObjectiveWhen using Linux commands or shell programming, this usage often encounters 2>&1 If it is just beginning to touch Linux, this thing really does not understand, because he has

Numerical calculation of shell-variables

The numerical computation of a variable is like a command.(()), let, expr, BC, $[]Here's a look at the operator of numeric calculations650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/8C/92/wKioL1hwVHaicj-lAAEicHK4YyY296.png-wh_500x0-wm_3 -

Shell determines whether a file or folder exists

#!/bin/sh mypath= "/var/log/httpd/" myfile= "/var/log/httpd/access.log" #这里的-x parameter Judging $ Whether the MyPath exists and has enforceable permissions if [!-X ' $myPath]; then mkdir "$myPath" fi #这里的-D parameter to determine if

Connector in Shell

(1) Command1;command2Use ";" , the Command2 is executed regardless of whether the Command1 executes successfully.(2) Command1 && Command2When you use &&, Command2 is executed only if Command1 executes successfully, otherwise Command2 does not

Shell file Number Comparison

Echo ' 1.2*2 ' |BC++++++++++++++++ Digital ComparisonMode 1:Agm1=50Agm2=60If [3-eq 3-a ${agm1}-ne ${agm2}-a ${agm2}-gt ${agm1}-a ${agm1}-ge 50-a ${agm1}-lt ${agm2}-a ${AGM2}-le 60- o 4-GT 3]; ThenEcho ' Yes 'ElseEcho ' No 'FiMode 2:Agm1= ' ye 'Agm2=

Linux Shell Script Applet 2

1, read from file whileRead Line Do Echo "line= $line" Donefile. txt2, converts a string to an array, and iterates through STR="html, CSS, JavaScript, java, PHP, go, python"arr= (${str//,/ }) forIteminch${arr[@]} Do Echo "item= $item" Done3,

Shell Writing script Ideas

Shell Scripting Ideas: (Requirements analysis)1, lamp source One key integration=======================1) Install Apache, Mysql, PHP, lamp integration;------------------------Installing ApacheInstall MySQLInstall PHP-------------------------2) to

Basic Bash Shell command--2

1.psReview the process. It only shows the processes that are currently user-owned under the current console, including bash and PS commands themselves.2.topReal-time detection process. The first line of the output shows an overview of the system

The most basic shell scripting

First, the basic writing process of the practice script:1. Determine the task and the command to complete the task2. Scripting Integration Tasks3. Authorization and test executionSecond, exercise:A. First I create a directory, put the script we

Change the return value into an array variable under the shell

Under BASH2, you can use the ($ ()) combination to obtainVar= ($ (cat/etc/passwd |awk-f ': ' {print $} ' |head-3))Returns the full value of the array:Echo ${var[@]}OrEcho ${var[*]}To take an array of members:echo ${#var [@]}Orecho ${#var [*]}Take a

SSH service and peanut shell domain name analysis

First, the installation instructions for the CentOS 5 example1, install the necessary development kits [[email protected] ~]# yum install gcc gcc-c++ autoconf automake2. Download phddns-2.0.2.16556.tar.gz to a directory [[email protected] ~]# wget

Shell Scripts split Nginx logs and regularly clean up [do not restart nginx]

The script is as follows:#! /Bin/bash# Nginx access log segmentation shell script# Log DirectoryLog_dir = "/usr/local/nginx/logs /"Cd $ log_dirTime = 'date + % Y % m % d -- date = "-1 day "'# Log Retention daysSave_days = 15# Location where the log

Total Pages: 541 1 .... 290 291 292 293 294 .... 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.