home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


3.2.111 printf

printf 

FILEHANDLE

 

FORMAT

 

LIST


printf 

FORMAT

 

LIST

This function prints a formatted string to FILEHANDLE or, if omitted, the currently selected output filehandle, initially STDOUT . The first item in the LIST must be a string that says how to format the rest of the items. This is similar to the C library's printf (3) and fprintf (3) function, except that the * field width specifier is not supported. The function is equivalent to:

print 

FILEHANDLE

 sprintf 

LIST

See print and sprintf . The description of sprintf includes the list of acceptable specifications for the format string.

Don't fall into the trap of using a printf when a simple print would do. The print is more efficient, and less error prone.