Daily shell exercise (--sed) processing

1. ExercisesFor a file, 1 to 5 lines delete the line with English, 6 to 10 lines delete the English characters inside;2. AnalysisThis requirement, with the SED command can be solved, mainly used to match the knowledge of replacement.3. Scripts#!/bin/

Deployment of the Shell

Shell's unfolding 2018-5-30? writen by Stephen.yu First, path name expansionBefore the shell executes the echo command, it automatically expands any qualifying characters on the command line, for example, * is expanded to the current path

Shell (i)

File header#!/bin/shBasic syntax:Define variables:Your_name= "Aivy"In addition to explicitly assigning values directly, you can also assign a value to a variable using a statement: for file in ' ls/etc ' or for file in $ (LS/ETC)The above statement

Shell Script Summary

1. VariablesA: Define variable a=1, only valid for your shell processB: Define the variable export b=1, which will take effect on your shell process and its child processesC: Variables defined in the script.sh script, when source script.sh is in the

The difference between Shell $* and $@

1#! /bin/Bash2 Test () {3echo "not quoted, same as"4Echo $*5echo [email protected]6echo "Add quotation mark and contrast"7 forN in "$*"8 Do9 Echo $NTen Done One Aecho "----------" - forN in "[email protected]" -

Shell–grep Common usage

is a powerful text search tool that can use regular expressions to search for text and print matching lines.I often use it to find strings such as: grep -rn "字符串" .Recursively finds the "string" in all files in the current directory and the line

Linux Shell shortcut keys

CTRL + A: Adjust the cursor to the beginningCtrl+e: Adjust cursor to endCtrl+u: Delete the command before the cursorCtrl+k: Delete the command after the cursorCtrl+r: Search A History list for a command "search for a History"Ctrl+l: Clear ScreenCTRL

Linux Shell Script Programming

The shell script shell is a non-type interpreted language, which is defined when assigning a value to a variable.#!/bin/bash //环境说明- chmod o+x 文件名 //命令行运行 /bin/bash file name//Ibid. function $ variable name//reference variable $//The name

centos-shell-Special Characters

Shell wildcard characters# notice is completely different from regular, similar to regular  * any of at least one character ? Any one character  [ ] [] any one of the characters, the relevant character set a-Z 0-9Shell redirection# re-designation of

The Column-aligned field of the shell command

You can convert text results to neat tables, upper and lower commands: ColumnParameters to use:-T: Table with a space interval by default-S: Required with-t use, specify delimiter?Monitor Ogg named field alignment [[Email protected]

003-shell Passing parameters

I. OverviewYou can pass parameters to the script when you execute the Shell script, and the format of the parameters obtained in the script is:$n. n represents a number, 1 is the first argument to execute the script, 2 is the second argument to

Shell conditional expression

1. The common syntax for conditional testing is as follows1, test expression2. [Test expression] #两边需要有空格3, [[Test expression]]4, (test expression))DescriptionThe first and second are equivalent, the third is the extended Test command, and syntax 4

Shell Script Forloops

1. Determine the type of all files in the/var/directoryfor files in /var/* ;do if [[ -f $files ]];then echo "$files exists and is a regular file." elif [[ -h $files ]] ;then echo "$files is a symbolic link." elif [[ -d

Shell scripts from getting started to complex three (passing parameters)

when executing a Shell script, parameters can be passed to the script, and the format of the parameters obtained in the script is: $n. n represents a number, 1 is the first argument to execute the script, and 2 is the second parameter that executes

Shell Simple to use

First, the history of the command linePress up and down to traverse the most recently entered command after entering incremental modeThis can be viewed in the previous 2000 history$ vim ~/.bash_historySecond, edit the command line : Delete the

Shell scripts-Applications for loops

Array= ('Brand' 'Brandinfo' 'Brandbaojia' 'Vehicletype' 'Brandbaoyang' 'Youhui' 'Config' 'Comment' 'Ownerprice' 'article' 'Usedcar' 'Video' 'MALLGCT' 'Mallimport' 'Baike' 'Machineoil' 'Tire' 'Yanghu' 'Chepin' 'Product' 'Newcar' 'Daogou' 'Tech'

Daily Shell Exercises (06)--Detection port service

1. TopicsWrite a script to determine whether the 80 port of the machine (assuming the service is httpd) is open, if it is open to do nothing, if the discovery port does not exist, then restart the httpd service, the concurrent mail notify yourself.

Shell Programming (1)

Shell Command Application Exercise(1) The use of the following documents is briefly reviewed through the Help information①/ETC/PASSWD (Hint: View this file description description via man 5 passwd)②/etc/shadow (Hint: View this file description

Java executes shell scripts and outputs execution

1. Script test.sh, placed in the/users/hdwang directory#!/bin/sh/users/hdwangechols: 'ls'for (( i=1; i; i++)); Do Echo $ (expr31); Sleep 1s Done echo JPS: ' Jps-l '2.java Execution test.sh Public classExecshell { Public Static voidMain (string[]

Shell script from getting started to complex Quad (array)

multiple values can be stored in an array. The Bash Shell supports only one-dimensional arrays (which do not support multidimensional arrays), and the subscript for array elements starts with 0. The Shell array is represented by parentheses, and the

Total Pages: 541 1 .... 435 436 437 438 439 .... 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.