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-' dirname $ ' to navigate to the relative location of the run script

Example 1.The new test.sh content under/home/admin/test/is as follows:CD 'dirname $0echo 'pwd'Then return to/home/admin/to executesh test/test. SHOperation Result:/home/admin/testThis allows you to know the location of the files deployed with the

How to intercept strings in the shell

This article mainly introduces the shell script 8 kinds of String interception method summary, each method gives the example code and operation results, at a glance, the need for friends can refer to the nextString interception of Linux is useful.

Initial knowledge of the shell

Words do not say much, straight to the subject, LZ is not bad at writing an article, just record their own learning process in a bit drops.Note: The shell is sensitive to case letters. Open terminal appears: [email protected]$ Span style=

Shell scripting counts multiple CPU utilization

The main contents of this section:Top command to count CPU utilizationOne, problem analysisMySQL is multi-threaded under Linux and can only distribute multiple threads to a single CPU.Therefore, using a small server, or PC server, multiple CPU

Shell Scripting Learning Notes-user input processing

1. Command-line arguments1.1 Parameters space-delimited, format: $+position, e.g. $, $, $, where $ $ represents the script name, more than 10 parameters, e.g. the 10th parameter is represented by ${10};1.2 Simple example:1.3 Through the

IDC production environment detects if IP is in use in shell scripts

#!/bin/bash # # ip_check    This shell script takes care of checking all IPAddress. # # Create by Xuekun # date 2015-12-6 # Beijing Open Source # source function library. ./etc/rc.d/init.d/functions App_path= ' pwd ' Log_path=${app_path}/ip_

Shell command Exercise 20160425

1, in three ways to achieve delete the last line of the file.[[email protected] sjx]# cat 123123[[email protected] sjx]# sed ' $d ' 12312[[email protected] sjx]# cat 123 |head-$[$ (cat 123|WC-L) -1]12[[email protected] sjx]# cat 123 |sed-n ' $!p ' 12

Delivery of data between commands in the shell

1. Piping "|"ls | Cat-n > OUT.txt2. Child shell2.1 Child Shell DescriptionYou can use the () operator to define a child shell in a shell script#/bin// ; ls) pwdExecution results  Description: Does not have any effect on the current shell when the

Shell a week of learning experience

Learning Shell The script experience Shell script Run Environment:Shell script, is to put multiple commands, organized into a file, to implement a series of actions, convenient execution of a file. Shell scripts are primarily used in

Prevent long execution of shell scripts resulting in SSH timeouts

In some scenarios where security requirements are high. SSH timeout is pre-set by the administrator, after idle for a period of time SSH connection will be actively disconnected.This scenario assumes that the script runs through SSH and the script

Shell First Knowledge

1. Basic Shell Syntax: (Hello,shell)#!/bin/bashecho"Hello,shell! "The results of the operation are conceivable: Console output:Hello,shell2.Shell variable definitions and references:#!/bin/Bashvalue="hello,shell"echo $valueRunning Result:

Linux Video Learning 3 (shell and Network)

1.shell of learning.There are three types of shells:/bin/sh,/bin/csh,/bin/ksh.See what kind of shell is currently in use: Command env (displays the environment variables for the current operating system).Change the shell type: chsh-s/bin/cshShell

Linux Shell ls-1 column display file

spl

/******************************************************************************* * Linux Shell Ls-1 Column Display file * Description: * Sometimes when writing shell scripts, it is often necessary to list the files in a column, and then the * for

Steps and shell scripts for installing Jdk1.8 and resin4.0.45 in CentOS7.2

1. Installation of JavaJdkHttp://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html1.1, Installation jdk-1.8[Email protected] ~]# lsanaconda-ks.cfg Desktop jdk-8u77-linux-x64.rpm [[email protected] ~]# RPM-IVH

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

Linux Shell abs--Special characters

The special characters are as follows: "#"--Comment, beginning with # at the beginning of the line (#! is an exception).“;” --the command delimiter, which can be used to write multiple commands on a single line.“;;” --Terminates the "case" option.“.”

FileZilla Unable to determine the target of the drag-and-drop operation because the shell is not properly installed __ workaround

FileZilla Unable to determine the target of the drag-and-drop operation because the shell is not properly installed __ workaroundAfter reloading the system and related software, using FileZilla to drag and drop files on the FTP file to the desktop,

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 programming (vi)---------arrays and functions

Definition of the array:Array name = (element 1 element 2 element N) # A pair of parentheses indicates an array, and the elements of the array are separated by a "space" symbol.Example: myarray= (1 3 5 7 9) # Note the method defined, parentheses,

Total Pages: 541 1 .... 363 364 365 366 367 .... 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.