How it works...

While this is a pretty important topic revolving around data types (especially when dealing with math or calculations), we broke the solution to this recipe up into two parts:

  1. In step 1, echo is pretty straightforward. We have mentioned in the past that there are special characters and escapes. \t stands for tab \r\n a new line in Windows (although in Linux, \n\n would have sufficed) and again, we could print out a fancy UTF character:
$ bash echo-mayhem.sh Currently we have seen the command "echo" used before in the previous scriptCan we also have \t tabs? \r\n\r\n? NO, not yet!Can we also have       tabs? ? YES, we can now! enable interpretation of backslash escapesWe can also have:Check the man pages for more info ;)
  1. However, ...

Get Bash Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.