asa - Interpret ASA/FORTRAN carriage control

Format

asa [file ...]

Description

Historically, printouts that are created by programs use the first character of each line to control the spacing between that line and the previous one. For example, if the first character is a space, the rest of that line immediately follows the previous line; if it is a 1, that line should begin on a new page, and so on.

asa reads input in this format and writes it out in a normal text format, using newlines, formfeeds, and carriage returns to achieve the same effects as the carriage control characters.

If you specify files on the command line, asa reads input from these files; otherwise, it reads the standard input. asa writes output to the standard output.

It does not copy newline characters in the input to the output. Instead, it uses the first character of each line to determine how to print the rest of the line. asa interprets the first character as follows:
Space
Outputs the rest of the line without change.
0
Outputs a newline character before printing file.
1
Outputs a formfeed (start a new page) sequence before printing file.
+
Outputs a carriage return sequence so that file is output over the previous file. If + starts the first line, it is treated as a space.

Localization

asa uses the following localization environment variables:
  • LANG
  • LC_ALL
  • LC_CTYPE
  • LC_MESSAGES
  • NLSPATH

Exit values

0
Successful completion.
1
Failure due to any of the following reasons:
  • Write error on standard output.
  • Inability to open the input file.
2
Unknown command-line option.

Portability

POSIX.2, X/Open Portability Guide, UNIX System V.