tr
translates or deletes characters.
Passing -d
tells tr
it's going to delete the SET1
of characters it's provided
"`~@#$%^&*=+<>{}[]|/'" is the set of characters to be deleted.
<
is a shell redirection character
$<
is a one of the automatic make variables which identifies the name of the first prerequisite
So you're deleting all characters from that specific set that are found in the first prerequisite in the given make rule.
Here's a simple example -
Makefile:
all:text.txt
tr -d "\`~@#$%^&*=+<>{}[]|/'" < $<
Now given this text.txt file:
$ cat text.txt
huio7&*(njkvlsan7u#%$&*(FHhnjkl
run the make file and you'll see:
$ make
tr -d "\`~@#^&*=+<>{}[]|/'" < text.txt
huio7(njkvlsan7u%$(FHhnjkl
The &
, *
, and #
are all missing now.
The vertical bar |
is a pipe character which will take the output from this first command and send it to the next.
You asked why the $
and %
weren't removed, the answer is because there are some characters that Make treats special. Take a look at the actual output of the command:
$ make
tr -d "\`~@#^&*=+<>{}[]|/'" < text.txt
The line that make
actually executed did not include the $
and the %
because make
recognized special characters that didn't have escape characters (backslash) with them. Example, let's escape the %
:
New Makefile:
all:text.txt
tr -d "\`~@#$\%^&*=+<>{}[]|/'" < $<
Now running this command we see:
$ make
tr -d "\`~@#\%^&*=+<>{}[]|/'" < stupid_text.txt
huio7(njkvlsan7u$(FHhnjkl
See how the %
showed up in the make output and the string now has removed the %
?