.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved .TH "ASA" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual" .\" asa .SH NAME asa \- interpret carriage-control characters .SH SYNOPSIS .LP \fBasa\fP \fB[\fP \fIfile\fP \fB...\fP \fB]\fP\fB\fP .SH DESCRIPTION .LP The \fIasa\fP utility shall write its input files to standard output, mapping carriage-control characters from the text files to line-printer control sequences in an implementation-defined manner. .LP The first character of every line shall be removed from the input, and the following actions are performed. .LP If the character removed is: .TP 7 The rest of the line is output without change. .TP 7 0 A is output, then the rest of the input line. .TP 7 1 One or more implementation-defined characters that causes an advance to the next page shall be output, followed by the rest of the input line. .TP 7 \fB+\fP The of the previous line shall be replaced with one or more implementation-defined characters that causes printing to return to column position 1, followed by the rest of the input line. If the \fB'+'\fP is the first character in the input, it shall be equivalent to . .sp .LP The action of the \fIasa\fP utility is unspecified upon encountering any character other than those listed above as the first character in a line. .SH OPTIONS .LP None. .SH OPERANDS .TP 7 \fIfile\fP A pathname of a text file used for input. If no \fIfile\fP operands are specified, the standard input shall be used. .sp .SH STDIN .LP The standard input shall be used only if no \fIfile\fP operands are specified; see the INPUT FILES section. .SH INPUT FILES .LP The input files shall be text files. .SH ENVIRONMENT VARIABLES .LP The following environment variables shall affect the execution of \fIasa\fP: .TP 7 \fILANG\fP Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of IEEE\ Std\ 1003.1-2001, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) .TP 7 \fILC_ALL\fP If set to a non-empty string value, override the values of all the other internationalization variables. .TP 7 \fILC_CTYPE\fP Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files). .TP 7 \fILC_MESSAGES\fP Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. .TP 7 \fINLSPATH\fP Determine the location of message catalogs for the processing of \fILC_MESSAGES \&.\fP .sp .SH ASYNCHRONOUS EVENTS .LP Default. .SH STDOUT .LP The standard output shall be the text from the input file modified as described in the DESCRIPTION section. .SH STDERR .LP None. .SH OUTPUT FILES .LP None. .SH EXTENDED DESCRIPTION .LP None. .SH EXIT STATUS .LP The following exit values shall be returned: .TP 7 \ 0 All input files were output successfully. .TP 7 >0 An error occurred. .sp .SH CONSEQUENCES OF ERRORS .LP Default. .LP \fIThe following sections are informative.\fP .SH APPLICATION USAGE .LP None. .SH EXAMPLES .IP " 1." 4 The following command: .sp .RS .nf \fBasa\fP \fIfile\fP .fi .RE .LP permits the viewing of \fIfile\fP (created by a program using FORTRAN-style carriage-control characters) on a terminal. .LP .IP " 2." 4 The following command: .sp .RS .nf \fBa.out | asa | lp \fP .fi .RE .LP formats the FORTRAN output of \fBa.out\fP and directs it to the printer. .LP .SH RATIONALE .LP The \fIasa\fP utility is needed to map "standard" FORTRAN 77 output into a form acceptable to contemporary printers. Usually, \fIasa\fP is used to pipe data to the \fIlp\fP utility; see \fIlp\fP. .LP This utility is generally used only by FORTRAN programs. The standard developers decided to retain \fIasa\fP to avoid breaking the historical large base of FORTRAN applications that put carriage-control characters in their output files. There is no requirement that a system have a FORTRAN compiler in order to run applications that need \fIasa\fP. .LP Historical implementations have used an ASCII in response to a 1 and an ASCII in response to a \fB'+'\fP . It is suggested that implementations treat characters other than 0, 1, and \fB'+'\fP as in the absence of any compelling reason to do otherwise. However, the action is listed here as "unspecified", permitting an implementation to provide extensions to access fast multiple-line slewing and channel seeking in a non-portable manner. .SH FUTURE DIRECTIONS .LP None. .SH SEE ALSO .LP \fIfort77\fP , \fIlp\fP .SH COPYRIGHT Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .