Erik Heinrichs
See also: CAT
cat , which comes from English “catenate”, synonymous with “concatenate” (either: concaténer) is a Commande Unix standard allowing concaténer files like posting their contents on the standard exit - usually a terminal Unix; generally “Shell S”, in particular Bash, Zsh, HSC, etc
TAC is the equivalent of cat but posts the contents of a file end at the beginning.
Specifications
" Individual UNIX Specification " (specifications of the standard UNIX) determined that the behavior of the order would be to post the contents of each files given in argument on the left standard in only one and even sequence. Used with the option " -u" (not used by version GNU), this order posts each Octet (byte in English) as soon as it is read, without using of buffer memory (buffer).If the option " -" is applied, cat will read the entered standard (example: keyboard) and will post it in the sequence of exit. If there is no file in argument, cat will read starting from the standard entry.
cat thus allows fast and passive posting contents of a file.
Extensions
The two versions BSD and version GNU Coreutils of cat support the following options:-
-b (GNU only: --number-nonblank), to number the not-white lines at exit.
- -n (GNU only: --number), to number the lines at exit.
- -s (GNU only: --squeeze-blank), amalgamates into only one all the white lines which are followed.
- -v (GNU only: --show-nonprinting), posts the not-printable characters as if they were visible except for the tabulations and of the characters of end of line (EOF: End Off Line).
- -t with BSD or -T with GNU, has the same behavior that -v but posts also the tabulations in the form of ^I.
- -e with BSD or -E with GNU, has the same behavior that -v but posts also the characters of end of line in the form $.
A little culture Unix
Definition of the Jargon Slips by
The “jargon Slips by”, in its version 4.3.3, defines the order cat as follows:- Is used to post, without stopping, a whole file with the screen or on another standard exit.
- By extension, is used to send a great quantity of data to a not prepared target or not intending to read them carefully. The order thus is regarded as limited.
For the fans of Unix, cat is regarded as an excellent example of what is a design " Use-interface " because, on the one hand, it gives the contents of the file without unexpected complement like a space or separators between the files and, on the other hand, it does not require that the file consists of lines of text but functions with any type of data.
For the detractors of Unix, cat is regarded as the prototype of a bad design " Use-interface " because its name is particularly badly selected. Indeed, this order is used much to post single to card-index on the standard exit than for concaténer several files. In fact, the name cat is thus as not-intuitive as the name of the order Cdr in Lisp for example the purpose of which, it, is to extract a pointer.
Cat and UUOC
UUOC , extracted from comp.unix.sh ell on Usenet, means “Useless Use off cat” (either: useless uses of cat). As some of comp.unix.sh ell pointed out it, the goal of the order cat is of concaténer files. If it is used on only one file, it is a waste of time and an useless overcost of resources: The purpose off cat is to concatenate (gold “catenate”) files. Yew it' S only one file, concatenating it with nothing At all has waste off time, and costs you has processExamples of UUOC
One sees making: cat file | autres_commandes with their arguments instead of: < file autres_commandes with their arguments or more classically: autres_commandes with their arguments < file who make the same thing but are less expensive in term of resources.
Since 1995, rewards are given occasionally for the best useless uses of cat (UUOC). It often happens that Randal L. Schwartz, author of many books on Perl and consulting in programming, gives these rewards. There is besides a Web site only devoted to the UUOC Award like with other similar rewards. For the Hacker S, the activity to remove UUOC is sometimes called demoggification (“Moggy” being a term of English the Commonwealth indicating a domestic cat affectionately, “has cat”).
External bonds
- "Individual Unix Specification" of cat
- UUOC Awards
Handbooks
- Manual official in French of Manual control CAT
- of cat of Manual GNU coreutils
- of cat of OpenBSD
| Random links: | Saint-Name-of-Jesus | Michele-Barbara Pelletier | Worsen Windrush | Half The Perfect World | The Real Me | Erik_Heinrichs |