This repository has been archived by the owner on Sep 16, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from tamada/ship_v1.0.0
ref #2 change cli library to ogier/pflag.
- Loading branch information
Showing
9 changed files
with
119 additions
and
106 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
title: Demo | ||
--- | ||
|
||
## Demo | ||
|
||
```sh | ||
$ cat -n testdata/test1.txt | ||
1 a1 | ||
2 a1 # <- is the duplicate of the previous line. | ||
3 a2 | ||
4 a2 # <- is the duplicate of the previous line. | ||
5 a3 | ||
6 a4 | ||
7 a1 # <- is the duplicate of the first line. | ||
8 A1 | ||
$ uniq testdata/test1.txt | ||
a1 | ||
a2 | ||
a3 | ||
a4 | ||
A1 | ||
$ uniq -a testdata/test1.txt # same result as uniq command. | ||
a1 | ||
a2 | ||
a3 | ||
a4 | ||
a1 # <- this line is not deleted. | ||
A1 | ||
$ uniq -i testdata/test1.txt # ignore case | ||
a1 | ||
a2 | ||
a3 | ||
a4 | ||
$ uniq -d testdata/test1.txt # print delete lines. | ||
a1 | ||
a2 | ||
a1 | ||
``` | ||
|
||
## Delete duplicate entries in PATH | ||
|
||
```sh | ||
export PATH=$(echo $PATH | tr : '\n' | uniq2 | paste -s -d : -) | ||
``` | ||
|
||
* `tr : '\n'` replaces `:` to `\n` of data from STDIN, | ||
* `uniq2` deletes duplicate lines from the result of `tr`, and | ||
* `paste -s -d : -` joins given strings with `:`. |
This file was deleted.
Oops, something went wrong.