ASA(1POSIX)

πŸ’– ASA(1POSIX) πŸ’–

ok so bestie, welcome to the POSIX Programmer's Manual page for asa, section 1. pull up a chair, grab a strawberry πŸ“, and let's get into it.


🌸 PROLOG 🌸

ok so first things first, this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ, so lowkey go check the corresponding Linux manual page for the deets on Linux behavior. or β€” and hear me out β€” the interface might not even be implemented on Linux at all. 😭 not me finding out the hard way. so like, vibe check your system first.


✨ NAME ✨

asa β€” interpret carriage-control characters πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

asa [file...]

πŸ¦‹ DESCRIPTION πŸ¦‹

ok so here's the tea β˜•. the asa 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. yes bestie, "implementation-defined" β€” that's the whole vibe of this one.

the first character of every line shall be removed from the input, and then the following actions are performed. πŸ‘‘

so if the character removed is:

  • <space> β€” the rest of the line is output without change. no notes, it just vibes through. ✨
  • 0 β€” a <newline> is output, then the rest of the input line.
  • 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. πŸ“„βž‘οΈ
  • + β€” the <newline> 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. and if the '+' is the first character in the input, it shall be equivalent to <space>. periodt. πŸ’…
⚠️ okay so important: the action of the asa utility is unspecified upon encountering any character other than those listed above as the first character in a line. so like, don't do that. fr fr.

πŸ’… OPTIONS πŸ’…

None. not a single one. she's minimal, she's iconic, she needs nothing. πŸŽ€


🌈 OPERANDS 🌈

  • file β€” a pathname of a text file used for input. and if no file operands are specified, the standard input shall be used. 🫢

⭐ STDIN ⭐

so the standard input shall be used if no file operands are specified, and shall be used if a file operand is '-' and the implementation treats the '-' as meaning standard input. otherwise, the standard input shall not be used. see the INPUT FILES section, bestie. πŸ‘€


🌸 INPUT FILES 🌸

the input files shall be text files. that's it. that's the section. πŸ’œ


🧚 ENVIRONMENT VARIABLES 🧚

the following environment variables shall affect the execution of asa:

  • LANG β€” provide a default value for the internationalization variables that are unset or null. (see the Base Definitions volume of POSIX.1‐2017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)
  • LC_ALL β€” if set to a non-empty string value, override the values of all the other internationalization variables. she overrides. main character energy πŸ‘‘
  • LC_CTYPE β€” 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).
  • LC_MESSAGES β€” determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
  • NLSPATH β€” determine the location of message catalogs for the processing of LC_MESSAGES.

πŸ”₯ ASYNCHRONOUS EVENTS πŸ”₯

Default. she's chill like that. 😌


✨ STDOUT ✨

the standard output shall be the text from the input file modified as described in the DESCRIPTION section. go back up and reread it if you skipped, i see you. πŸ™ˆ


πŸ’€ STDERR πŸ’€

None. silence. iconic behavior. 🀫


πŸŽ€ OUTPUT FILES πŸŽ€

None.


πŸ¦‹ EXTENDED DESCRIPTION πŸ¦‹

None.


πŸ‘‘ EXIT STATUS πŸ‘‘

the following exit values shall be returned:

  • 0 β€” all input files were output successfully. slay! βœ…
  • >0 β€” an error occurred. 😭

🌈 CONSEQUENCES OF ERRORS 🌈

Default.

the following sections are informative.


πŸ“ APPLICATION USAGE πŸ“

None.


πŸ’– EXAMPLES πŸ’–

  1. the following command:
asa file

permits the viewing of file (created by a program using FORTRAN-style carriage-control characters) on a terminal. so cute, so useful 🫢

  1. the following command:
a.out | asa | lp

formats the FORTRAN output of a.out and directs it to the printer. ✨ pipeline princess ✨


🧠 RATIONALE 🧠

ok so the asa utility is needed to map "standard" FORTRAN 77 output into a form acceptable to contemporary printers. usually, asa is used to pipe data to the lp utility; see lp.

this utility is generally used only by FORTRAN programs. the standard developers decided to retain asa 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 asa. so like, you can run the apps without the whole compiler situation. we love accessibility. πŸ’œ

historical implementations have used an ASCII <form-feed> in response to a 1 and an ASCII <carriage-return> in response to a '+'. it is suggested that implementations treat characters other than 0, 1, and '+' as <space> 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. πŸŒ€ iykyk.


⭐ FUTURE DIRECTIONS ⭐

None. the future is bright and also empty. πŸ’…


🌸 SEE ALSO 🌸

fort77, lp

the Base Definitions volume of POSIX.1‐2017, Chapter 8, Environment Variables


portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 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 .

any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. to report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


ok that's the whole page bestie, you ate that πŸ’…βœ¨ this masterpiece was brought to you by IEEE/The Open Group, dated 2017, and it lives at ASA(1POSIX). go forth and interpret those carriage-control characters, queen. πŸ‘‘πŸ¦‹πŸ’–

πŸ“¦ where this page comes from