printf
If your output vocabulary and style needs another level of maturation, the Korn Shell provides the printf command. The “f” in printf stands for “formatted.” So, this command provides some formatting options for your output. It can handle floating-point displays, integer displays, and string displays. If this is starting to sound familiar to you C language programmers out there, it should. The printf command is based on the printf function available in the standard C library.
Its syntax includes a quoted format section followed by the variables to be placed in the formatted specification. The format string can contain zero or more control variables, which will be replaced by the respective variables at the end of the command line.
The control ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access