Following is a revised and updated Commands and Utilities proposal. It makes some minor changes to the older proposal, and includes a section on individual command differences. It also includes a note on options not specified by the standard.
--8<------ Linux Standard Base Commands and Utilities Initial Proposal, v. 0.2 Introduction ------------ In an effort to maintain a commonality between Linux based operating systems and other GNU-like operating systems, LSB uses as the basis for its command and utility list the list of commands from the Single UNIX Specification, version 2, also known as UNIX98. However, in some cases it is either not possible for Linux based operating systems to comply and remain completely Free Software/Open Source, and in other cases a different program is more widely used on Linux based operating systems that provides the same functionality. Those places where LSB diverges from UNIX98 are detailed here, with rationale for each. For a listing of commands and utilities specified by UNIX98, along with a link to descriptions of how each command should operate and a note as to what package a Free Software/Open Source version of that command is available, see http://www.linuxbase.org/cu/ Package Differences ------------------- SCCS commands - admin, delta, get, prs, rmdel, sact, sccs, unget, val, what Divergence: UNIX98 defines these commands as part of the Development option. LSB defines them as Legacy Development commands. Rationale: SCCS is not widely used on Linux-based platforms, and has been widely replaced by RCS and CVS. No application should depend on any of these commands being present, though. Compression commands - compress, uncompress, zcat Divergence: These commands are mandatory in UNIX98. LSB marks them as Legacy. Instead, the commands gzip, gunzip, and zcat (from GNU Zip) are mandatory. Rationale: Compress uses a patented algorithm and is therefore tricky to redistribute. GNU Zip is Free Software unencumbered by patents, and also quite often produces better compression ratios than compress, as well as being the current de facto standard for compressed file distribution on Linux-based operating systems and other GNU-like operating systems. Archiving utilities - cpio, tar Divergence: UNIX98 marks cpio and tar as legacy. LSB marks them as mandatory. Rationale: The tar format is the de facto standard for software distributed as source. It is important to be able to unpack this source on Linux-based systems. Also, the cpio command can be used to extract individual files from RPM files, which seems to be the current de facto standard for binary software distribution. Individual Command Differences ------------------------------ echo SYNOPSIS echo [-n] [-e] [string ...] OPTIONS -n Do not print a newline after string. -e Enable escape characters. NOTES Default support for escape characters is implementation dependant. In order to be sure that escape characters are enabled, use the -e option. Use of command line options is not portable outside of LSB. Rationale: UNIX98 specifies no options for echo. Linux has traditionally supported both -n and -e, and it is expected that they are supported. Also, the -n option is useful. UNIX98 recommends using printf for maximum portability, as the System V and BSD versions of echo differed in their interpretations of options. If portability is a major concern, printf is recommended. ln SYNOPSIS ln [-f] [-s] source_file target_file ln [-f] [-s] source_file... target_dir OPTIONS -f Force existing destination pathnames to be removed to allow the link. -s Create a symbolic (or soft) link rather than a hard link. NOTES Use of the -s option is not portable outside of LSB. Rationale: UNIX98 doesn't specify the -s option. The Linux kernel has supported symbolic links since (what, forever?). Symlinks are widely used on Linux-based systems, and should be supported on all such sytems. mail, mailx The LSB mail command combines the specifications of UNIX98's mail and mailx commands, providing the mailx functionality whenever the two definitions conflict. This program must be available as both mail and mailx. Rationale: The mailx argument -s is often passed to mail, and many other features of mailx are usually assumed from mail. Note that passing arguments specified in the mailx definition to mail is not portable outside of LSB. Global Differences ------------------ In addition to specific differense mentioned above, there are some differences that take a global scope. Command line options Many of the open source implementations of these commands supply options beyond those specified in UNIX98. In particular, most GNU programs provide long options (options beginning with two dashes) such as --help and --version. Applications should not depend on the existance of any options not specified here or in UNIX98, or lack of such options. The behavior of programs is not specified when passing other options (for example, false --version may in fact use STDOUT and return a true value). --8<------ Comments and suggestions are of course welcome (I'm sure I've missed something or other that someone will desperately want/need). -- Jakob 'sparky' Kaivo - [EMAIL PROTECTED] - http://jakob.kaivo.net/
