printf %100s will print 100 spaces, and
tr " " "=" will convert those spaces to equal signs, effectively printing 100 equal signs.
Breaking it down:
printf is a shell built-in. It typically takes two or more arguments, the first of which is a "format string" and the rest will be used to fill up placeholders in that format string. Once that template is fully filled, it will print out the result. If there are more arguments left, it will start over, filling up more arguments and printing the resulting string.
The format string used for
printf takes format specifications, which start with
% and end with a single letter, so
%d means an integer (using the decimal base, therefore "d"),
%f means a floating-point number and
%s means a string of characters. Characters other than letters after the
% are modifiers for the format specification and, in particular, numbers are used to specify the requested length of the field on output. So
%100s will format the string to have at least 100 characters, it will pad it with spaces and it will keep it aligned right (in other words, add spaces at the beginning of the string.)
If passed an extra argument, it would use it for that
%s field, so for example
printf %100s abc will print 97 spaces (to get to 100 total, considering the 3 in "abc") followed by the actual string "abc". But if no argument is given, then the format specification is filled with an empty or null argument (which is an empty string for
%s, it would be 0 for
%d, etc.) So that's the same as if an empty string was passed, such as
printf %100s ''. The end result is that only the 100 character padding is printed.
So, putting it all together,
printf %100s results in 100 spaces printed.
tr is a tool to translate characters from input to output. It takes two arguments, SET1 and SET2, each a set of characters, and then translates the first character of SET1 into the first of SET2, the second character of SET1 into the second of SET2 and so on.
tr reads its input from stdin and writes it back to stdout (so it's very useful in pipelines like the one above.)
tr will always translate all occurrences of that character in a given string.
tr aeiou 12345 will translate lowercase vowels into the numbers 1 to 5 in that order, so it will translate "queueing" into "q52523ng" for example. You can also pass it character ranges, such as
tr a-z A-Z to turn any lowercase letter into its corresponding uppercase one.
tr " " "=" is simply translating spaces into equal signs throughout the string. The first space needs to be quoted to be recognized as an argument. The
= doesn't actually need to be quoted, but doing so doesn't hurt.
tr " " = would have worked the same.
Putting it all together, print 100 spaces, then translate each of them into equal signs.
Hopefully this explains it in enough detail, but if there's still something you don't understand, please leave a comment and I'll try to address that.