Using awk to process large volumes of data in shell scripts

First, the demand      original file a for 1.7g file, with 5 1700 Mangyo look. There are also 2 auxiliary files b and C, b c files are only 2 column. a1 and b1 same, A2 and C1 a1 B2, c2" a4 a5, the target file is named d.txtSecond,

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

September 13, 2015 and 15th "shell, Sed&awk use (i)"-jy1506402-19+liuhui880818

Directory:First, the operation Principle of shell programSecond, Shell common skills1. Command history2. Command aliases3. Command Reference4. File name Wildcard5. Common shortcut keys6. Complement function7. Input and output redirection and piping8.

&& in Shell-linux | |

When the shell executes a command, it returns a return value that is saved in the shell variable $? In When $? = = 0 o'clock, indicating successful execution; = = 1 o'clock, which indicates that the execution failed.    www.2cto.com   Sometimes the

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

A simple script that automatically creates shell scripts

Because I usually write some small experimental script, every time to write author,description and so very troublesome, then wrote such a script can create their own small script, code as follows, pure personal original, relatively rough, big God

Shell statistics Word Frequency script

  #!/bin/bashif [$#-ne 1];then echo "usage:$0 filename"; Exit-1fifilename=$1egrep-o "\b[[:alpha:]]+\b" $filename | awk ' {count[$0]++}end{printf ("%-14s%s\n", "Word", "Count"), for (Ind in count) {printf ("%-14s%d\n", Ind,count[ind]);}}

Some application scenarios for the shell

List the number of connections per IPawk ' /^tcp/{print} ' awk ' !/^::/{print $ {} ' Sort Uniq Sort awk ' begin{printf "%-10s%s\n", "Connum", "IP"}{printf "%-10s%s\n", $1,$2} 'Command explanation: Netstat-n refused to display aliases, can

20150913 Day Course Assignment (shell)

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 status, etc., to take the picture of

Linux:shell Common wildcard characters

character meaning * Match 0 or more characters ? Match any one character [list] Match any single character in the list [!list] Matches a character other

[Goto] Shell script for synchronizing hive data updates

Introduction:The previous article, Sqoop1.4.4, implements the import of incremental data from oracle10g into Hive0.13.1 and updates the primary table http://www.linuxidc.com/Linux/2014-09/106282 in hive. The HTM describes the principle 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 difference between a Linux shell source and a.

First, use '. ' Perform1. Contents of the file:a.sh#!/bin/sha=2echo a= $ab.sh#!/bin/sh./a.shecho a.sh:a= $a2. Add executable permissions# chmod +x a.sh b.sh3. Running#./b.sh a=2a.sh:a=It can be seen that a in b.sh does not get the A variable in a.sh,

Example of awk, if while in shell

1. If while command is written in one lineWhile read a b;do echo $a $b;d one 12 13 14Cat Aa.txt12 13 14if [[$i-eq 0 | | $i-eq 2]]; then env=10.79.40.146:80; else env=10.79.40.147:80; Fi2. Awk merges two filesAccount CdrCat AccountZhang San

Shell 99 Multiplication Table

#!/bin/bashfor I in {1..9}dofor j in ' seq 1 $i ' dom= ' echo "$i" "*" "$j" |bc ' Echo-n "$j" x "$i" = "$m" "" Doneecho "" DoneExecution Result:[Email protected] shell]#./99.sh1 x 1 = 11 x 2 = 2 2 x 2 = 41 x 3 = 3 2 x 3 = 6 3 x 3 = 91 x 4 = 4 2 x 4 =

Jenkins, Ant Ctomcat+shell reported Ant:command not Foun.

#!/bin/sh# Licensed to the Apache software Foundation (ASF) under one or more# Contributor license agreements. See the NOTICE file distributed with# This work for additional information regarding copyright ownership.# The ASF licenses this file to

Scala VS python2 (Linux or shell) not completed

PS: Only consider the latest version of Scala and python2.x, due to the difference between python3.x and python2.x, and the mainstream of some open source projects are used Python2, currently python2 a little bit compatible python31.

[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

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

Multi-thread Linux Shell script and linuxshell

Multi-thread Linux Shell script and linuxshell In bash, we run (&) in the background to implement multithreading. for((i=1;i We have added {} & so that the execution in {} can be performed in the background. The above is equivalent to executing

Total Pages: 541 1 .... 479 480 481 482 483 .... 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.