Skip to content
/ union Public

The `union` command for Unix text processing

Notifications You must be signed in to change notification settings

SixArm/union

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

The union command for Unix text processing

Print the lines that are in any of the inputs.

Syntax:

union <input> ...

Example:

$ union 1.txt 2.txt
=> lines that are in either of the files.

Notes

The order doesn't matter.

In set theory, this command is (A union B).

This command is currently implemented using awk and POSIX.

Related

Related commands for Unix text processing sets:

  • union: print lines in (A union B)
  • intersect: print lines in (A intersect B)
  • except: print lines in (A except B) a.k.a. (A - B)
  • extra : print lines in (A extra B) a.k.a. (B - A)

Examples:

$ cat 1.txt
alpha
bravo

$ cat 2.txt
alpha
charlie

$ union 1.txt 2.txt
alpha
bravo
charlie

$ intersect 1.txt 2.txt
alpha

$ except 1.txt 2.txt
bravo

$ extra 1.txt 2.txt
charlie

Tracking

  • Program: union
  • Version: 2.0.2
  • Created: 2017-01-30
  • Updated: 2017-01-30
  • License: GPL
  • Contact: Joel Parker Henderson (joel@joelparkerhenderson.com)

About

The `union` command for Unix text processing

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages