Knowledge about shell scripts

1. Exec Read lineRushid = $ lineExec is a pipeline command, which is generally not used separately.Read from the CSV file and assign each line to lineRead is used to accept keyboard input in shell. Line is a variable that accepts output parameters.

Shell script find command

The find command is used for searching. It has powerful functions in the following format: Find pathname-options [-print-Exec-OK...] Pathname: directory path searched by the find command. For example, use "." To represent the current

Array and traversal in Linux Shell

When using shell in Linux, arrays are occasionally used for convenience. The declaration method of the array is: Array = (element1 element2 element3... elementn) That is, wrap the array elements directly with parentheses, and separate the array

How to use shell scripts to implement automatic Telnet

Many people think that, like passwd and Su, Telnet cannot work automatically through pipelines and input redirection, but in fact Telnet supports input redirection. although, strictly speaking, shell scripts cannot enable telnet to enter the

Linux Shell: Yum command reference

Option-Y: The operation is performed without user confirmation.   Yum-y install : Install the specified software.   Yum-y update: Upgrade the software.   Yum-y update : update a specific file   Yum check-Update: checks whether software needs

Pay attention to spaces when writing shell.

Below is a simple Linux ShellCodeThe function is used to find the current directory and all its directories which contain the four characters "html" and print the file name, at first glance, there should be no problem with this code, but there are

Search for shell scripts that replace text in multiple files in Linux

Use Find and SED # First query the number (sed-N) Find.-Name '*. htm' | xargs sed-n'/old/P' # Replace (sed-I) Find.-Name '*. htm' | xargs sed-I's/old/new/G' Use grep and SED Grep-l old *. htm | xargs sed-n "/old/P"Sed-n'/old/P' grep-l old *.

Linux 9 Shell

Course outline 『Shell programming syntaxShell script debuggingShell application instance』A simple shell programShell Structure:1 .#! Specifies the shell for executing the script2. # comment rows3. command and control structureTo create a shell

Special characters in Linux Shell

Special characters in Linux Shell 1. braces: Usage 1: wildcard Extension Eg: ls my _ {finger, toe} s This command is equivalent to a combination of the following commands: Ls my_fingers my_toes For example: mkdir {usera, userb, userc}-{home, bin,

Shell numeric and string comparison

Comparison of strings and values in Shell Binary comparison operator, which compares variables or numbers. Note the difference between numbers and strings. Integer comparison -EQ equals to, for example, if ["$ A"-EQ "$ B"]-Ne is not equal to, for

Some special $ headers in Shell

$0 script execution name $ N the nth parameter value of the script, n = 1 .. 9 $ * All parameters of the script $ @ All the parameters of the script (which have similarities and differences with $) $ # Script parameter count $ PID for Script

How to directly read database values in shell and assign them to variables

In actual project development, there are many applications that retrieve data from the database. The general solution is to write a data retrieval method. the SQL script is then called and obtained in the shell program. In fact, these two steps can

Shell record time

Shell has two built-in variables about time,You have never used it,I have never used it,Today is also the first time to see,So I added a note,For future reference.$Seconds: the time when the script has been run.(In seconds).$TmoutIfTmoutThe

Linux Shell shortcut

Summary of Linux Shell shortcut operations (including shortcut keys and efficient operations ): CTRL +: Start with the command line CTRL + E: End of the command line CTRL + L: Clear screen, equivalent to the clear command CTRL + u: Cut the content

Linux Shell notes-awk1

One Separator1. Single separator (for example, extract the 11:22:33 string 11 22 33)Echo 11:22:33 | awk 'in in {FS = ":" };{ Print $1 "" $2 "" $3 ;};' 2. Define multiple delimiters (for example, extract string 11 22 33 44 from string 33 & 44)Echo '11

Shell obtains the current system time

In shell scripts, you often need to obtain the system time to process an operation. Today, the system learns how to obtain the system time. The record is as follows: Linux system time can directly call system variables in shell, for example:Get the

Linux Shell study Note 2

  Chapter 4 directory operations 4.3.1 column directory $ Ls directory -D option, force to display only the directory name, not the content   4.4 operation directory 4.4.1 create a directory Mkdir directory Example: $ mkdir hw1 Create the hw1

Linux Shell study Note 5

Lesson 6 variables Part 2 shell programming 7.1 define variables Format: Name = value # Note: there cannot be spaces on both sides of the equal sign! This is different from other scripting languages: value can be defined as a variable value without

Linux Shell Study Notes 10

14th class hour Functions 14.1 create and use functions Format: Name () {list ;}   An important feature of Shell functions is that they can be used to replace binary executable files or shell built-in commands with the same name. For example: CD () {

Monitor shell operations using undisclosed Functions

Monitor wwwa.applevb.com by using undisclosed Functions In Windows, there is an undisclosed function shchangenotifyregister. You can add it to the system message monitoring chain in your window. This function is available in Delphi.Is defined as

Total Pages: 541 1 .... 390 391 392 393 394 .... 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.