Shell two file comparison, same character removed to another text

##!/bin/bashecho "pleases Enter A.txt file (enter Q to exit)"READ-DQ Aecho ""echo "pleases Enter B.txt file (enter Q to exit)"READ-DQ Becho ""Cat >/root/a.txt $AEofCat >/root/b.txt $BEofC= ' Cat/root/a.txt | Grep-f/root/b.txt 'D= ' Cat/root/a.txt |

Linux shell Script Learning Note one

First, file comparison operators-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file [-f/usr/bin/grep]-L filename True if filename is a

Shell Learning Essays

Cat/dev/null > FileName Empty file information Trash, the data sent to the secondary file will be deleted. W.H.O. | Wc-l calculating the number of users | (pipeline) can be two more programs between the establishment of a pipeline pipe:who output

Shell string Processing

Output the top 10 system user names and UID numbers of the current system to the screenhead/etc/passwdString interception1${variable name: Start position: Length}echo ${variable name: Start position: Length}Variable name =${variable name: Start

Common shell commands under Mac

Today, let's introduce some common shell commands in the Mac Terminal:1. View the full path to the current working directoryPwd(PWD's original intention is: Print work directiory, not password password meaning, hehe)2. View the command's detailed

Shell script structure and execution methods

[[email protected] ~]# mkdir shell[[email protected] ~]# cd shell/[[ email protected] shell]# vim first.sh#!/bin/bash                                 must be # #the  first test shell script.             Description # #written  by guozhen.mkdir 123   

Shell Uniq and sort simple usage and examples

Sort by the second character of the 1th field, if the field is only 1 characters followed by a number, the order of the letters after the normal sort of 2 charactersRepeated lines in a uniq are repeated without repeating rows, such as:1122And the

Reproduced String interception of Linux shell scripts

Suppose there is a variable var=http://www.google.com/test.htmA # Intercept, delete the left character, and leave the right character.Echo ${var#*//}where Var is the variable name and the # is an operator, *//indicates that the first//number and all

Shell Input/Output redirection

Most UNIX system commands accept input from your terminal and send the resulting output back to?? to your terminal. commands usually read input from the standard input, which is the default terminal . Standard output, which is the terminal by

Shell programming: Automatically format the hard drive and mount it

This script is not a complete script, has not implemented automatic mount partition, each disk is divided into 2, 1 partition for the 1g,2 partition of 2G.#!/bin/bashCount= ' fdisk-l|grep/dev/sd.*|grep-v '/dev/sda.* ' |wc-l 'I=1While [$i-le

Shell implementation Trim Function-removes spaces on both sides of the string (including the Tab,space key)

The shell implements the trim function effect to remove spaces on both sides of the string, and the following three commands are equivalent, all of which can be implementedSed ' s/^\s*//' totrim.txt |sed ' s/\s*$//' >trimed.txtSed ' s/^\s*//;s/\s*$//

Shell script face Questions

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7C/D6/wKioL1bZELvR0rU7AAF_GjuzRYI110.png "title=" 6.png " alt= "Wkiol1bzelvr0ru7aaf_gjuzryi110.png"/>#!/bin/bashif [!-d/rhome]then mkdir-p/rhomeficontinueuid=1000for i in ' seq 1 ';d oecho

Shell Scripting compilation

First, replace the text:# #1Sed-i ' s/disabled=true/disabled=false/'/etc/fdfs/storage.conf# #2Sed-i ' s/base_path=\/home\/yuqing\/fastdfs/base_path=\/fdfs\/storage/'/etc/fdfs/storage.conf# #3echo "Enter tracker_ip:"Read Tracker_ipecho "$Tracker

Various judgment grammars in the shell

Shell judgment#按照文件类型进行判断-B To determine if the file exists and whether it is a fast device file (The block device file is true)-C Determines whether the file exists and whether it is a character device file (the character device file is true)-D to

Function of Shell programming

The definition of the shell function is almost the same as the normal C language function.function () {}The return value of the Shell function can be displayed, and if there is no return then the execution result of the last statement will be

Shell Bash Ksh

The shell is an interactive command interpreter. The shell is independent of the operating system, which gives the user the flexibility to choose the right shell for them. The shell lets you type commands at the command line, which is interpreted by

IP network address and broadcast address calculation for shell scripts

This is an old-fashioned exercise, shell script to practice a lot, want to practice shift calculation, there is the following script.#!/bin/bashippattern= "(\\.) {3}\ "maskpattern=" [1-9]| [12] [0-9]|3[01] "while :d o  echo -e -n "

JMeter Bean Shell Use (ii)

Previous JMeter Bean shell Use (a) a brief introduction of the bean shell in the next jmeter, this article is a supplement to the above, mainly summarizes the common scenarios and methods, I believe these basic can cover most of the needs. This

8 Shell Command's find

The Find command, which is used as often as a CD. It is only possible that the majority of the time it takes only one or two parameters to be used. Or, barely enough. But when we take the initiative to look at the manual of Find, we will find that

Hill Sort (Shell)

The essence of the hill sort is the grouping insert sort, which is also known as narrowing the incremental sort.The basic idea of this method is that the whole sequence of elements is divided into several sub-sequences (consisting of elements

Total Pages: 541 1 .... 323 324 325 326 327 .... 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.