How to remove duplicate lines using awk?
If you type echo "Hi\nHow\nHi\nAre\nHi\nYou?\nAre"
, you will get this in your terminal:
Hi
How
Hi
Are
Hi
You?
Are
Here’s how we can remove the duplicate lines using awk
..
If you type echo "Hi\nHow\nHi\nAre\nHi\nYou?\nAre"
, you will get this in your terminal:
Hi
How
Hi
Are
Hi
You?
Are
Here’s how we can remove the duplicate lines using awk
..
Tiny snippets showing if/else use in awk
..
Some times I would need to define an alias in tcsh which can have optional arguments. tcsh doesn’t seem to support that directly.
Here’s how I solve that problem.
This post shows how to get the current directory name without the
preceeding path, using awk
or rev
+cut
or the boring basename
.