Daily shell scripting Exercises (01)

0. IntroductionPrepare to open a new pit and update a shell practice every day. Because shell scripts belong to the kind of skills that are unfamiliar or even forgotten when you're not practicing, I can only keep on practicing in order to resist the

Shell Regular Expression

Shell Common Regular ExpressionsCommon Regular expression ^ # line Header locates $ # end of row. # match any character except line break * # match 0 or more repeating characters + # Repeat once or more? # repeat 0

Linux Command Application large dictionary-11th Chapter shell programming

11.1 Declare: Show or set shell variables 11.2 Export: Display or set environment variables 11.3 Set: Display and set shell variables 11.4 unset: Deleting a variable or function 11.5 env: Viewing and setting environment variables

Basic operators for Shell script programming

1. Arithmetic operator: Native bash does not support simple math operations, but can be implemented with other commands, such as awk and expr,expr most commonly usedExpr is an expression evaluation tool that uses it to perform the evaluation of an

Shell exercises (13)

Exercise 1:Formatted outputRequirements: Enter a string of random numbers and then output by thousand. for example, the input number string is "123456789", the output is 123,456,789#/bin/bash# date:2018 March 15 read-p "Please input a long number:"

Commands and special symbols in the shell

1. Record the command:!!! : Continuous "! "indicates that the last instruction was executed! N: Represents the second instruction in the execution of the command historyNote:! 2 actually shut me down.! String (string greater than 1) indicates the

Shell exercises (11)

Exercise 1:Statistics and summationRequirements: calculates the number of digits that appear in each row in document 1.txt and calculates a total of several numbers in the entire document.Reference Answer:#!/bin/bash# date:2018 March 6 sum=0for i in

Shell uses a small note

The shell is the preferred system administrator for its stability, efficiency and flexibility.1. Shell Introduction:Command line: Refers to the interface for the user to enter a command, which itself simply accepts input and then passes the command

Shell script cuts tomcat log files

Transferred from: http://www.cnblogs.com/lishun1005/p/6054816.htmlIn view of debugging Logback and log4j file cutting has not been successful, with the shell to write a script to cut Tomcat under the log file (everyone if you have in Logback or

01:shell Basic Use

1.1Write a login welcome script(1a new script file, welcome.sh, is used to output various monitoring information. [[Email protected]~]#vi/root/welcome.sh#!/bin/bashEcho"Number of open processes: $ (PS aux | wc-l)"Echo"number of logged-in users: $

Full-Library hot backup of shell scripts

#!/bin/bashbackup_dir=/oracle/backuplog_file= $ORACLE _base/admin/$ORACLE _sid/hold_backup_$oracle_sid.logecho   "Backuping cold backup"  > $log _filedata>> $log _filesqlplus -s /  As sysdba > $log _filealter database backup controlfile to   '

Shell Exercises (iii)

Exercise 1:Batch Change file nameRequirements: Find all files with the suffix. txt in the/123 directory Bulk Modify. txt to. txt.bak Package all. bak files into 123.tar.gz The name of the batch restore file, that is, to remove

Shell exercises (i)

Exercise 1: Generate a file every dayRequirements: please generate a daily file according to the date format (XXXX-XX-XX), for example, the file generated today is 2018-02-05.log, and write the disk usage to this file (do not consider Cron, just

Tai Hang record-shell script delete operation

BackgroundJenkins executes the shell command, which references some Jenkins variables, such as ${workspace}, because each execution of Jenkins is slow, so I want to copy the script to local debugging, directly copied the script to execute, the

Shell Script Foundation II

Processing of strings1. Interception of stringsMethod one, using the ${} expressionFormat: ${var: Start position: Length}Phone= "13788768897" # echo ${#Phone} 11 When you use ${} to intercept a string, the

DAY11 Shell Script Basics (enginner05-2)

Vi. condition testing and selection 6.1 test expression-file Status Test6.1.1 [-E file]File exists with a value of true;file does not exist as false6.1.2 [-D file]File exists and is a directory with a value of true;file does not exist as false6.1.3 [

DAY11 Shell Script Basics (enginner05-1)

First, IntroductionIt is an executable file. Design executable statements in advance to accomplish specific tasks1.1 Common script typesBash ShellPython/perl/rubyjsp/php/asp/cgiJavascriptThe biggest advantage of 1.2 shell languageCan be fully

An array of special variable types in the shell

There are two types of data in the shell: one is a numeric type, the other is a string type , and although the shell itself is a weak type, it can be so distinguished.If we need to store multiple values in a variable in the shell, we need a more

An example of passing parameters in Shell programming and an example of shell Parameters

An example of passing parameters in Shell programming and an example of shell Parameters When executing a Shell script, we can pass parameters to the script. The parameter format obtained in the script is $ n. N indicates a number. 1 indicates the

Shell programming echo command usage instructions, shell programming echo command

Shell programming echo command usage instructions, shell programming echo command Shell echo commands are similar to PHP echo commands and are used to output values. We can use echo to implement more complex output format control.Show normal

Total Pages: 541 1 .... 514 515 516 517 518 .... 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.