Linux Learning 21-shell Programming Basics

Shell Programming BasicsThe shell is a program written in C that is a bridge for users to use Linux. The shell is both a command language and a programming language. A Shell is an application that provides an interface through which users access the

Shell date format and numeric operations

#!/bin/Bash#declare D="2016-05-06 00:00:00"#d1=$(Date-D"$d"+%s);Echo$d 1#d2=$(Date+%y%m%d%h%m%s-d @ $d 1) #Echo$d * Current time month day #declare Currentsecond=$(Date+%y%m%d%h%m%S) #declare currentminute #当前时间 month and day=$(Date+%y%m%d%h%M)

Linux Learning Summary (57) Shell Script 1

1 What shell?Shell is a scripting languageYou can use logical judgments, loops, and other syntaxFunctions can be custom-definedThe shell is a collection of system commandsShell scripts enable automated operations, which can greatly increase our

CentOS7 automatically install BIND server shell script

#!/bin/bash##################################################################### auto install  BIND#CREATEDATE:2018-05-31#WRITTENBY&NBSP: Wind Flower # organization:   hbgslz.com###################################################################

Shell variables and landing

The shell has a shell meaning, which provides the platform for the user to interact with the kernel, and the kernel then implements the functionality through the underlying system call. Features of the Linux shell:1. Shortcut: Ctrl + A (ahead) move

Considerations for using SSH-free remote command execution in a loop in Shell programming

Prerequisite: Configure your own machine ssh password-free login#!/bin/bashCat list1234EODWhile Read lineDoif SSH [email protected] "test-f/tmp/a.sh"; Then #配置了免密登录, no password is entered hereecho "$line file exist."Elseecho "$line file not exist."

Basic usage of the shell

SHELL:An interface program that completes the interactive operation between the user and the operating system, providing the user with simplified operation;In the middle of the 70 's, Bell Lab, Bourne;bourne Shell, abbreviated Sh;bill JOY:C Shell,

The difference between the source in the shell and the direct execution sh

First, we know that there are several ways we execute the shell.1. Sh/bash uses its built-in command set to execute some commands, such as the followingSH Demo.shbash demo.sh2. Use./or $SHELLPATH/*.sh the way to

15th-Shell Regular Expressions

15th-Shell Regular ExpressionsSee pictureClassification of regular expressions for Shell regular expressions Basic Regular Expressions (basic Regular expression also known as basic RegEx abbreviation Bres) Extended Regular expression

Shell periodically transfers log files to cloud disk and periodically deletes cloud disk files

The shell script is processed periodically as follows: Cat /home/backup/logs_delete. SH #!/bin/bash/bin/find"*.log*" -mtime +4 -type f| Xargs mv {}/mnt/logs/nginx//bin/find"*.log*" -mtime +30 -type f| Xargs RM-L04 * *

Use of SED tools and regular expressions (Shell fourth day)

Sed tool "streaming editor"--Non-interactive, filter based on pattern matching and modify text--progressive processing and output of the results to the screen--can achieve the output of the text, delete, replace, copy, cut, import, export and other

Shell file expression

file Expression-e filename true if filename exists-d filename If filename is a directory, true-F filename True if filename is a regular file-L filename True if filename is a symbolic link-r filename If filename is readable, true-W filename if

Experimental three---shell programming

In addition to being an interpreter, the shell is a high-level programming language with variables, keywords, and a variety of control statements.Command historyHistory displays a list of historical commands, including its ownHistory 50 shows the

Linux Shell Programming (eight): Looping structure

Looping statementsThe looping statements in the shell are as follows: for while unitl case select For/while/unitl must end with done forCycleforLoops are used to iterate through an array (data list) or

Exception handling, module package, Time module, subprocess (Invoke shell command)

Exception handlingYou can use the Try/except statement to catch an exception.The try/except statement is used to detect errors in a try statement block, allowing the except statement to catch exception information and handle it.If you do not want to

Experiment three, Shell programming

first, the contents of the experiment1. Practice command history, aliases, and special character usages in the shell (4th. 4.2, Section ~4.5)2. Shell command application exercise (see Experimental steps)3. Write a shell script that executes in 4

Shell Project-Alarm system

Requirements: Use the shell to customize a variety of personalized alarm tools, but the need for unified management, standardized management.Idea: Specify a script package that contains the main program, subroutine, configuration file, mail engine,

Experimental three shell programming (1)

One, Shell command application exercises1. Describe the purpose of the following documents①/etc/passwdpasswd is a password file that is used to manage the user's password. Ordinary users can usually only modify their own password

Linux Shell Programming (vi): operations

Op-ExpressionsThe expression is contained in or (()) or [] within, An arithmetic expression:(()) ((expression)) This expression is calculated according to the rules of arithmetic calculation. Equivalent to let expression .

Nine arrays in the shell

Array: A variable that stores a set of data and is able to manipulate one of the data in this set of data individually.Types of arrays: one-dimensional arrays, two-dimensional arrays, multidimensional arraysTypes of variablesThe default value of an

Total Pages: 541 1 .... 243 244 245 246 247 .... 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.