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.

Some small shell scripts

JudgeProgramWhether it exists, and start its #! /Bin/sh Echo-e "\ 033 [32 m redmine starting \ 033 [0 m"Redmine-2.1.4/CD/u02/Ruby script/rails server webrick-e production-dVar = $ (PS-Ef | grep Ruby | grep-V grep | WC-l)If [$ var-GT 0]ThenEcho-e "\

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

In Windows 7, emacs 24 shell uses gitbash

Today, we found that gitbash can be directly opened in shell. gitbash provides some useful Linux-style commands. The most important thing is that you do not need to open another gitbash terminal to manipulate git when using Emacs. In ~ The

Shell programming technology and example-Linux Kernel Analysis and Operating System Design

Although he does not know who Lu Jun is, his book is indeed easy to understand and has the meaning of training materials.. Linux Shell programming started from UNIX and was presented as a human-computer interaction tool in the early days. After

Calculate the farthest point of rotation on the card Shell

Struct point {int X, Y; point () {} Point (int xx, int YY) {x = xx; y = YY;} point operator-(point const & B) const {return point (x-b.x, y-b.y);} int friend operator * (point a, point B) {return f_abs (. x * B. y-a.y * B. x) ;}int len2 () {return x

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

Shell Command Line shortcut in Linux

eol

CTRLKey bound_____________CTRL +-Jump to the start of the lineCTRL + B-Move back a charCTRL + c-Terminate the commandCTRL + d-Delete from under the cursorCTRL + E-Jump to the end of the lineCTRL + F-Move forward a charCTRL + k-Delete to EOLCTRL +

FTP folder transmission shell script

######################################## ######################### ######################################## ######################### Ftp_download_file (){ EchoEcho begin: Download $1: $2...Echo Sleep 0 FTP-I-n Open $1User administratorBinMget

List of Common Unix shell commands

List of Common Unix shell commands Passwd Change User Password PWD print current directory CD change Directory ls list directory file wildcards *,? Any number of characters and a single character file print out the file type cat display

Shell for Linux Learning

What is shell? Shell is an interface for user interaction with the kernel. It can be used as a command interpreter. After a user inputs a command, shell will explain it and then send it to the kernel for execution,   After knowing what shell is, let

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 *.

Number of lines in the shell string

1. query the row number of the string. Grep-n "XXX" str.txt #-N print the prefix of the number of lines where the character "XXX" is located in the file "stringstr.txt" Example: Str.txt XxxYyyZzzXxx Enter the SEARCH Command: grep-n "XXX"

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

Time Command in Shell

Forwarded from blog: http://www.51testing.com /? Uid-390472-action-viewspace-itemid-232903   TimeCommand is used to print the execution time of a command or program.Time The time, system time, and time used in the execution of a command in

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 () {

Total Pages: 541 1 .... 450 451 452 453 454 .... 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.