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

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 +

Introduction to shell programming in Linux (3)

Iv. Loop Structure statements Common shell loop statements include for loop, while loop, and until loop. ForLoop Syntax: for variable in list Do Operation Done Note: The variable is used inside the loop to refer to the object in the List currently

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"

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

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

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

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

Bash instance, Part 1-basic programming of Bourne again shell (BASH)

By learning how to program using the bash scripting language, you can make the daily interaction of Linux more interesting and productive. You can also use the familiar and favorite standard UNIX concepts (such as pipelines and redirection ). In

Total Pages: 541 1 .... 445 446 447 448 449 .... 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.