Linux

  1. Home
  2. Computing & Technology
  3. Linux

Bash Guide For Beginners

From Authors, for About.com

6.3.6. The printf program

For more precise control over the output format than what is normally provided by print , use printf . The printf command can be used to specify the field width to use for each item, as well as various formatting choices for numbers (such as what output base to use, whether to print an exponent, whether to print a sign, and how many digits to print after the decimal point). This is done by supplying a string, called the format string , that controls how and where to print the other arguments.

The syntax is the same as for the C-language printf statement; see your C introduction guide. The gawk info pages contain full explanations.


   Prev    Home    Next
   The print program    Up    Summary

* License

* Bash Guide For Beginners Index

Explore Linux

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Linux

  1. Home
  2. Computing & Technology
  3. Linux
  4. Linux Documentation
  5. Bash Guide for Beginners
  6. Bash Guide For Beginners - 6.3.6. The printf program

©2009 About.com, a part of The New York Times Company.

All rights reserved.