The shell command loops through the directory to match the keywords

#!/bin/bashwhile read Linedo for file in/home/local/test/* does if test-f $file then sed-n "/${line }/p "$file >>/home/local/out.txt fi Donedone Task: To file from the Home/local/test folder belowFile_1.logFile_2

Shell scripts--string interception

If you want to intercept a string, you can do it by manipulating the subscript or pointer in C + +, and in a shell script, there are several ways to do this if you want to specify a string for interception:The following examples are used:str=

A method of string interception by the shell

Linux There are eight ways to intercept a string. Suppose there is a variable var=http://www.aaa.com/123.htm.1. # Intercept, delete the left character, leave the right character. The code is as follows:Echo ${var#*//}where var is the variable name

ArchLinux Shell Basic Learning

The first thing to know about scripting languages is that they are usually referred to as the parser for the command line interface. (from Wiki's explanation)Part I: Understanding the shellYou can see that #!/bin/sh and!/bin/bash are used here. But

Make your own Linux-->shell

Thank you for the 36,000 sectionCommon Shell Categories: BASH: is the GNU Bourne Again Shell, which is the default shell on the GNU operating system C Shell: The BSD version of Sun's shell Look at where the shell is on the

Make your own Linux-->shell

before starting the code, let's take a look at what a shell is. Shell English is also called the shell layer. In a computer, "system" software that "provides user interface", usually refers to the command parser of the command line interface. In

3rd Chapter Basic Bash shell commands

Start shellThe GNU Bash Shell provides interactive access to Linux systems. He runs as a regular program and usually starts when the user logs on to the terminal. When you log in, you start the shell based on the user profile/etc/passwd./ETC/PASSWD

Jenkind + git + mave + shell + Tomcat

Install the required plug-inEmail Extension Plugin GIT Plugin Publish over SSHInstall MAVEN JDK configuration e-mail triggers and other configuration login keys on a chapter blogNew MAVEN Project650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/

Shell (build file distribution System)

1. Requirements backgroundFor large companies, there must be a site or configuration file updates from time to time, and the use of the machine is certainly a lot of units, less than a few, more than dozens of or even hundreds of sets. Therefore,

Shell script: Row and column conversions

Writing SQL in MyBatis, such as SELECT, involves a long list of names.'int (null auto_increment, ' name ' varchar (COLLATE) utf8mb4_bin, ' mainimg ' varchar (null,... Now you want to convert the column names in the table description to a

Shell implementation of hive Automation test

This program mainly implements the Hive permission test. The system has the Administrator user single and test user tests. Under Path/home/test/, the pre-condition of the use case is written in the input folder, and each use case corresponds to an

Linux Gvim Shell While loop

#while循环: Used to continuously execute a series of commands and to read data from input files; commands are usually test conditions#格式如下:#while expression#do# Statement to being executed if expression is true#done#命令执行完毕, control returns to the top

Shell Script Simple Example (i)

#!/bin/bash# above is the shell script interpreter, which must be written at the beginning to represent the shell script. /bin/sh is more used under UNIX and features less than Bash. Use/bin/bash more, but/bin/sh is/bin/bash soft link in Linux.#

Shell built-in operator-string processing (summary)

First, Judge read the string value An expression meaning ${var} Variable var with the same value as $var ${var-default} If Var is not declared, then use $default

Interception of Shell strings

1, variable var from npos∈[0, Length-1] bit start, from left-to-right intercept num characters:    ${var:npos:num}Summary: If NPOs If NPOs > Length (Var)-1 Then the result is an empty string;If the character does not actually meet the NUM bit, it is

$* and $@ in shell script

In shell script, $* and [email protected] Both get all command-line arguments, but there is a slight difference between the two in use, the difference is mainly in the use of double quotes, that is, the direct use of $*,[email protected], or use "$*"

The Linux/shell of the interview question summary

LinuxLinux CSHRC file functionsHow Linux processes/view process/kill processWhat permissions does Linux file 755 represent?Linux worker threadsLinux inter-Process communication methodPipeline,msgq ...Inter-process Communication _ Baidu

Shell Basic Learning (vi) Process Control

1. IfSyntax format for IFif Conditon Then Command1 command2 " commandnfi2. If Elseif Conditon Then Command1 command2 " commandnelse Command1 Command2 "' commandnfi3. If ElseIf elseif Conditon Then

Shell Basics Learning (ii) Shell variables

1. Data type:StringArray2. Naming conventions for variables:Can only start with a-Z or a-ZCannot have spaces in the middle, you can use _Punctuation cannot be usedCannot use the SHELL keyword3. Variable type:Environment variablesLocal variablesShell

Concurrent concurrent shell scripts simulating multithreading in Linux

Share a concurrent script that simulates multithreading under Linux, using this script to execute related commands on a defined number of servers at the same time, which is much more efficient than a normal for/while loop and can be executed in a

Total Pages: 541 1 .... 309 310 311 312 313 .... 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.