fprintf

Description

The fprintf procedure is similar to the print procedure, except that the created formatted character string is appended to a file, rather than being displayed at the user’s terminal.

See the discussion on printf for a more detailed discussion on how to create use format command characters within the format control string.

Not supported in Endpoint Privilege Management for Linux (EPM-L).

Syntax

fprintf (filename, controlstring [,expression1, …]);

Arguments

filename Required. Character string that contains the name of a file. A fully qualified path name, starting with a forward slash character (/).
controlstring Required. The character string, including format command characters, that is written to filename.
expression1... Optional. Values to substitute into controlstring, based on the specified format command characters.

Return Values

Because fprintf is a procedure, no return value is set.

Example

In this example,

fprintf ("/var/adm/pblog.txt", "System administrator Ids: %s %s %s", "Adm1", "Adm2", "Adm3");

the character string System administrator Ids: Adm1 Adm2 Adm3 is appended to the file /var/adm/pblog.txt.

See Also

print, printf, sprintf(), syslog