[Reprint] "Shell script" line-by-row processing of text files

Transfer from http://www.cnblogs.com/dwdxdy/archive/2012/07/25/2608816.htmlThe style files are often processed on a line-by-row basis, how to get each row of data in the shell, then process the row data, and finally read the next row of data, loop

Three: Shell operators

1:declare commandshell Default is String typeIf subtraction is required, it needs to be defined as an integral typeDECLARE command: Change the default variable type Decalre [+/-] [option] Variable name-set type properties for variables+ Cancel

Shell Script Job

(1) Write a script: If a path does not exist, it is created as a directory, otherwise it is present, and the content type is displayed#!/bin/bash#if [$#-lt 1]; Then echo "Plz Enter a path:" Exit 1fi if [-e $]; Then file $1else mkdir-p $1fi ~Test

The shell practice of Linux Learning

The shell practice of Linux Learning 1. Describe the operation principle of shell program (can be attached with necessary graphic instructions);2, summarize all the knowledge points involved in shell programming (such as: variables, grammar,

Shell Calculation Tool Source code

#!/bin/bash# defines greatest common divisor and the minimum number of conventions gcd_result= "lcm_result=" "#定义一个相加的函数function  sum ()  { result=$ (  num1+num2 )   echo -e  "\033[31m  two number of $result \033[0m"}# Define a greatest common

Tips for Shell common commands

1.cdCD-Back to last catalogCD returns the current user's home directory2.mkdirMkdir-p Creating a multilevel directoryEg:mkdir-p Test1/test2/test33.findFind-empty Finding empty DocumentsFind-user XXX View all information about user xxxFind-mtime-1

Bash Shell Summary and examples

First, homework (exercise) content:1. Describe the operation principle of shell program (can be attached with necessary graphic instructions);2, summarize all the knowledge points involved in shell programming (such as: variables, grammar, command

Shell's "test" command

Read Catalogue Numerical test File test String test The test command in the shell is used to check if a condition is true, and it can be tested in three ways, such as numeric values, files, and characters.

Common Linux Commands Explanation (sixth day)--shell environment variables

Too lazy, these days seem to have been lazy cancer, do not want to write a blog. Later think about, knowledge, or share the good. The first to cure their own lazy cancer; second, consolidate your knowledge by the way. There are two types of

A random choice at noon where to eat the script, no big use ... Skilled in the use of the shell, welcome to vomit Groove ...

Tag:shell    function     menu print     [[email protected] scripts]# cat menu.sh #!/bin/bash################################# ## filename: menu.sh# describe: choose a place to eat# author:  lijun# create date: 2015-09-09# version: 1.0##############

The number of occurrences of a word in the shell statistics text

Ubuntu14.04Given a text, count the number of occurrences of the word# solution 1grep is used in conjunction with AWK and is written as a sh script fre. SH SH fre.sh wordfretest.txt#! /bin/Bash# solution 1if[$#-eq0 ] ThenEcho "usage:$0 args

The differences and usage scenarios for Shell, command, script, raw modules for Ansbile tools

has been misunderstood as the shell and command is the execution of remote commands, recently looked at the official help document only to find, made a low-level error, in fact, each module has its own application commonly used; Briefly explain the

Linux Shell String Common operations

Take the length of the variable [[Email protected] scripts]# var=oldboy123[[email protected] scripts]# echo  ${var}oldboy123[[email protected] scripts]# echo ${#var}9# For example: #以下判断用read输入一个值, if the length is 0, The value is empty,

UltraEdit Configuring shell script highlighting

1. Download the Wordfile extension package from the UE official website: http://www.ultraedit.com/files/wf/wf.zip2. Open the UltraEdit and click on the menu "advanced"-"Configure" To open the Configuration dialog box. Click "Editor

Use shell scripts to detect realserver status in LVS and implement automatic removal of attached hosts

#!/bin/sh# Describe:check the real server status# history:2015-08-25 22:21:38# Author:timPath=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binExport PATHvip=192.168.1.121dip=192.168.1.112rip= ("192.168.1.122" "192.168.1.123")Vport=8

[9-13] Shell Series 8--Arrays

This article is intended to review the definition and assignment of arrays in shell script programming, to read arrays, and to get the length of an arrayKnowledge Reserve Array : Multiple contiguous separate memory spaces, each memory

Shell concurrently executes multithreading

Encounter FTP to more than one machine problem, waiting for the last execution to execute the next, time will be longer, if you can simultaneously send files to multiple machines, you can achieve the purpose of saving time.Grammatical

Java implementation of Shell sequencing

PackageCom.edu.hpu.sort.insert.shell;Importjava.util.Arrays;ImportCom.edu.hpu.sort.Sort; Public classShellsortextendsSort {@Override Public int[] Dosort (int[] arr) { intLen =arr.length; //all step probabilities (for the first half of the

Shell array creation and usage tips

The Linux shell is much more powerful in programming than Windows batch processing, both in loops and operations. Data types are not comparable. Here's a summary of some of the things that an individual does when it comes to working with arrays.1.

Basic knowledge before learning shell scripts

Basic knowledge before learning shell scripts Chapter 2 LearningShellBasic knowledge before script In daily linux system management, shell scripts are indispensable. If you do not write shell scripts, you are not a qualified administrator. At

Total Pages: 541 1 .... 425 426 427 428 429 .... 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.