Shell script Common script: while

Whileconditional SentenceGrammar:Condition to meet always doneWhile conditionDoinstructionDone==========Conditional satisfaction exit (rare)Until conditionsDoinstructionDone  Script instance: Daemon monitoringSleep: Print per secondUsleep:

Shell [] differs from [[]]

[] and [[]] can determine whether the variable is empty, [ $a] [[$a]] [ ! $a] [[! $a]] No differenceIn Linux, we can use the test command to determine if a string is empty, and the test command gives us the "-Z option" and the "-N option," which you

Examples of expect and shell nesting use

#!/bin/shmaildir=/maildata/mailbox/gxm.cn/0olddir=/home/mailboxnewdir=/maildata/mailboxecho  ""  >/ root/lostmailidecho  ""  >/root/lostmailidokfor mailid in  "cat /usr/local/ Kkmail/log/app/postman.log.2018-03-06 | awk -f " "   ' {print $4} '

Using Shell to develop a springboard machine

Signal list:Common commands related to Linux and signaling are the kill and trap commands, down how to use traps to control the springboard script using the command:Command: Kill-l and Trap-lImportant signal and explanation of Linux system in

Shell built-in commands and operating methods

1.!#/bin/bashThis is the first line of the shell script, and/bin/bash represents the location of the script's interpreter.2. Run the script:    (1) Bash test.sh(2) Bash-x test.sh (ps:-x for observing script running state)(3) Release script

Shell gets string length

Method 1: Use the wc-l commandWc-l can get the length of the current row, so the string for a single row can be obtained in this simple way, and the wc-l is the number of rows that get the current string content.The code is as follows: Echo "ABC"

Shell script first-Custom create user and batch create user

Shell Script First-Custom create user and batch create user 1. build Linux users with shell scripts# vim/root/user.sh#!/bin/bash#通过脚本自定义创建用户read-p " Please enter the user name you want to create : " $Useradd $read-p " Please set the user password:

Shell Introduction Command history command completion and alias wildcard input and output redirection

8.1 Shell IntroductionThe shell is a command interpreter that provides interaction between the user and the machine to support specific syntax, such as logical judgment, looping each user can have their own specific shell CentOS7 default shell for

Shell Script implementation: 5 per week using the tar command to back up all log files under/var/log

Simple little script, big God DetourImplementation steps:1 Writing scripts2 Doing recurring planning tasks1 scripting[Email protected] ~]# vim tar.shScript content:#!/bin/bash#编写备份脚本, the file name contains a date label after the backup, preventing

Shell Foundation (i): Shell basic Application, simple shell script design, using shell variables, variable extension application

First, Shell basic applicationTarget:This case requires familiarity with the characteristics of the Linux shell environment, mainly practicing the following actions:1> switching the user's shell environment2> Practice Command History, command

8.1 Shell Introduction 8.2 command History 8.3 command completion and alias 8.4 wildcard 8.5 input/output weight

8.1 Shell IntroductionShell Introduction8.2 Command HistoryCommand-historyHistory environment variablesEmpty the history configuration fileModify the history fileEnable the history variable to take effectEnable history to take effectCan only append,

Shell printf Command

In the previous section we learned about the Shell's echo command, which we'll learn from the Shell's other output command printf.The printf command mimics the printf () program in the C library.printf is defined more by the POSIX standard, so a

Examples of ${}, #, # #,%, percent of% in the shell

DescriptionI believe that in the work, many friends in the use of shell scripts encountered ${},%, #等这些字符的使用, and occasionally they will be dizzy, and then I use the following example to let everyone very well remember the Shell ${}, # #和 percent

Rman Backup Script Shell version

1, the database is fully prepared to the hard disk[[Email protected] scripts]$ cat rman_backup.sh  source /home/oracle/.bash_ profile  rman target / log=/home/oracle/backup/backupall_rman.log2. Incremental backup ScriptLevel 0

Shell programming, backing up files across servers

Requirements: Query all files under a folder, change the file modification time to less than the current time, and be larger than the current time the previous day of the file backup to another server corresponding to the folderIdeas:1, recursive

Jenkins executes the shell command, sometimes prompting "command not found"

The problem is that environment variables are not accurately(1) Check that the maven you set in Jenkins is accurate, and you can see if there is a MAVEN option in the new job with the "New Job" button, not exactly what you configuredIf you download

A client-side shell script that installs the environment and services in one click

#!/bin/bashbasepath=$ (CD ' DirName $ '; pwd)Shell_dir= "${basepath}/shell"Package_dir= "${basepath}/package"############################# #install rpm###########################关闭不必要的软件并禁止开机启动Systemctl Stop FirewalldSystemctl Disable

The shell command under Linux

First, the basic command1. Immediately shutdown and restart, execute the following command: Shutdown-r now or reboot2. Immediately shutdown, execute the following command: Shutdown-h now or Poweroff3, wait 2 minutes shutdown and restart, execute the

Shell programming-common file handling commands

Touch commandThe touch command is used to create empty files, such as when an application wants a log file to exist before they can write to the data. You can create an empty file with the touch command: touch test1 ;The touch command can also be

Shell Array Definition and acquisition

Shell ArrayBash supports one-dimensional arrays (which do not support multidimensional arrays) and does not limit the size of arrays.Similar to the C language, the subscript of an array element is numbered starting with 0. Gets the elements in the

Total Pages: 541 1 .... 173 174 175 176 177 .... 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.