--- fold.1.old.txt Thu Jul 23 07:14:28 2009 +++ fold.1.new.txt Thu Jul 23 07:14:28 2009 @@ -4,96 +4,65 @@ User Commands fold(1) - NAME fold - filter for folding lines SYNOPSIS - fold [-bs] [-w width | -width] [file...] + /usr/bin/fold + /usr/bin/fold [ options ] [file...] + + ksh93 + fold [ options ] [file...] + DESCRIPTION - The fold utility is a filter that will fold lines from its - input files, breaking the lines to have a maximum of width - column positions (or bytes, if the -b option is specified). - Lines will be broken by the insertion of a NEWLINE character - such that each output line (referred to later in this sec- - tion as a segment) is the maximum width possible that does - not exceed the specified number of column positions (or - bytes). A line will not be broken in the middle of a charac- - ter. The behavior is undefined if width is less than the - number of columns any single character in the input would - occupy. + fold is a filter that folds lines from its input, breaking the + lines to have a maximum of width column positions (or bytes if + the -b option is specified). Lines are broken by the insertion of + a newline character such that each output line is the maximum + width possible that does not exceed the specified number of + column positions, (or bytes). A line will not be broken in the + middle of a character. - If the CARRIAGE-RETURN, BACKSPACE, or TAB characters are - encountered in the input, and the -b option is not speci- - fied, they will be treated specially: + Unless the -b option is specified, the following will be treated + specially: + carriage-return + The current count of line width will be set to zero. fold + will not insert a newline immediately before or after a + carriage-return. + backspace + If positive, the current count of line width will be + decremented by one. fold will not insert a newline + immediately before or after a backspace. + tab Each tab character encountered will advance the column + position to the next tab stop. Tab stops are at each + column position n, where n modulo 8 equals 1. - BACKSPACE The current count of line width will - be decremented by one, although the - count never will become negative. - fold will not insert a NEWLINE char- - acter immediately before or after - any BACKSPACE character. + If no file is given, or if the file is -, fold reads from + standard input. The start of the file is defined as the current + offset. - - CARRIAGE-RETURN The current count of line width will - be set to 0. fold will not insert a - NEWLINE character immediately before - or after any CARRIAGE-RETURN charac- - ter. - - - - TAB Each TAB character encountered will - advance the column position pointer - to the next tab stop. Tab stops will - be at each column position n such - that n modulo 8 equals 1. - - - OPTIONS The following options are supported: + -b, --bytes Count bytes rather than columns so that each + carriage-return, backspace, and tab counts as 1. + -c, --continue=text + Emit text at line splits. The default value is + '\n'. + -d, --delimiter=delim + Break at delim boundaries. + -s, --spaces Break at word boundaries. If the line contains + any blanks, (spaces or tabs), within the first + width column positions or bytes, the line is + broken after the last blank meeting the width + constraint. + -w, --width=width + Use a maximum line length of width columns + instead of the default. The default value is 80. - - -SunOS 5.10 Last change: 1 Feb 1995 1 - - - - - - -User Commands fold(1) - - - - -b Counts width in bytes rather than column - positions. - - - - -s If a segment of a line contains a blank - character within the first width column - positions (or bytes), breaks the line after - the last such blank character meeting the - width constraints. If there is no blank - character meeting the requirements, the -s - option will have no effect for that output - segment of the input line. - - - - -w width|-width Specifies the maximum line length, in column - positions (or bytes if -b is specified). If - width is not a positive decimal number, an - error is returned. The default value is 80. - - - OPERANDS The following operand is supported: @@ -102,7 +71,6 @@ used. - EXAMPLES Example 1: Submitting a file of possibly long lines to the line printer @@ -114,29 +82,17 @@ example% fold -w 132 bigfile | lp + ENVIRONMENT VARIABLES See environ(5) for descriptions of the following environment variables that affect the execution of fold: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH. + EXIT STATUS The following exit values are returned: - - - -SunOS 5.10 Last change: 1 Feb 1995 2 - - - - - - -User Commands fold(1) - - - 0 All input files were processed successfully. @@ -146,8 +102,8 @@ ATTRIBUTES - See attributes(5) for descriptions of the following attri- - butes: + See attributes(5) for descriptions of the following + attributes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | @@ -156,39 +112,29 @@ |_____________________________|_____________________________| | CSI | enabled | |_____________________________|_____________________________| - | Interface Stability | Standard | + | Interface Stability | Commited | |_____________________________|_____________________________| + This command conforms to IEEE Std 1003.1-2008. + SEE ALSO - cut(1), pr(1), attributes(5), environ(5), standards(5) + cut(1), ksh93(1), pr(1), attributes(5), environ(5), standards(5), + http://www.opengroup.org/onlinepubs/9699919799/utilities/fold.html + NOTES - fold and cut(1) can be used to create text files out of - files with arbitrary line lengths. fold should be used when - the contents of long lines need to be kept contiguous. cut - should be used when the number of lines (or records) needs + fold(1) and cut(1) can be used to create text files out of + files with arbitrary line lengths. fold(1) should be used when + the contents of long lines need to be kept contiguous. cut(1) + should be used when the number of lines (or records) needs to remain constant. - fold is frequently used to send text files to line printers - that truncate, rather than fold, lines wider than the - printer is able to print (usually 80 or 132 column posi- - tions). + fold(1) is frequently used to send text files to line printers + that truncate, rather than fold, lines wider than the + printer is able to print (usually 80 or 132 column positions). - fold may not work correctly if underlining is present. - - - - - - - - - - - - --- mktemp.1.old.txt Tue Jul 7 04:39:38 2009 +++ mktemp.1.new.txt Mon Mar 22 23:19:10 2010 @@ -6,106 +6,70 @@ NAME - mktemp - make temporary filename + mktemp - make temporary file, filename or directory SYNOPSIS - mktemp [-dtqu] [-p directory] [template] + /usr/bin/mktemp + /usr/bin/mktemp [ options ] [ prefix ] + + ksh93 + mktemp [ options ] [ prefix ] + DESCRIPTION - The mktemp utility makes a temporary filename. To do this, - mktemp takes the specified filename template and overwrites - a portion of it to create a unique filename. See OPERANDS. + mktemp creates a temporary file with optional base name prefix + prefix. If prefix is omitted then tmp_ is used and --tmp is + implied. If prefix contains a directory prefix then that + directory overrides any of the directories described below. A + temporary file will have mode rw------- and a temporary directory + will have mode rwx------, subject to umask(1). Generated paths + have these attributes: + * Lower case to avoid clashes on case ignorant filesystems. + * Pseudo-random part to deter denial of service attacks. + * Pseudo-random part may be 3-chars.3-chars on filesystems + which only support 8.3 file names. - The template is passed to mktemp(3C) for directories or - mkstemp(3C) for ordinary files. + A consecutive sequence of X's in prefix is replaced by the + pseudo-random part. If there are no X's then the pseudo-random + part is appended to the prefix. - If mktemp can successfully generate a unique filename, the - file (or directory) is created with file permissions such - that it is only readable and writable by its owner (unless - the -u flag is given) and the filename is printed to stan- - dard output. - mktemp allows shell scripts to safely use temporary files. - Traditionally, many shell scripts take the name of the pro- - gram with the PID as a suffix and used that as a temporary - filename. This kind of naming scheme is predictable and the - race condition it creates is easy for an attacker to win. A - safer, though still inferior approach is to make a temporary - directory using the same naming scheme. While this guaran- - tees that a temporary file is not subverted, it still allows - a simple denial of service attack. Use mktemp instead. - OPTIONS The following options are supported: - -d Make a directory instead of a file. + -d, --directory + Create a directory instead of a regular file. + -m, --mode=mode + Set the mode of the created temporary to mode. + mode is symbolic or octal mode as in chmod(1). + Relative modes assume an initial mode of u=rwx. + -p, --default=directory + Use directory if the TMPDIR environment variable + is not defined. Implies --tmp. + -q, --quiet + Suppress file and directory error diagnostics. + -t, --tmp|temporary-directory + Create a path rooted in a temporary directory. + -u, --unsafe|dry-run + Check for file/directory existence but do not + create. Who would want to do that + --help + Prints basic help information + --version + Prints version information - -p directory Use the specified directory as a - prefix when generating the temporary - filename. The directory is overrid- - den by the user's TMPDIR environment - variable if it is set.This option - implies the -t flag. - - - - -q Fail silently if an error occurs. - This is useful if a script does not - want error output to go to standard - error. - - - - - -SunOS 5.10 Last change: 4 Jun 2004 1 - - - - - - -User Commands mktemp(1) - - - - -t Generate a path rooted in a tem- - porary directory. This directory is - chosen as follows: If the user's - TMPDIR environment variable is set, - the directory contained therein is - used. Otherwise, if the -p flag was - given the specified directory is - used. If none of the above apply, - /tmp is used. In this mode, the tem- - plate (if specified) should be a - directory component (as opposed to a - full path) and thus should not con- - tain any forward slashes. - - - - -u Operate in unsafe mode. The temp - file is unlinked before mktemp - exits. This is slightly better than - mktemp(3C), but still introduces a - race condition. Use of this option - is discouraged. - - - OPERANDS The following operands are supported: template template can be any filename with one or more Xs appended to it, for - example /tmp/tfile.XXXXXX. + example /tmp/tfile.XXXXXXXXXX. If template is not specified, a - default of tmp.XXXXXX is used and - the -t flag is implied. + default of tmp.XXXXXXXXXX is used + and the -t flag is implied. @@ -113,36 +77,21 @@ Example 1: Using mktemp The following example illustrates a simple use of mktemp in - a sh(1) script. In this example, the script quits if it can- - not get a safe temporary file. + a sh(1) script. In this example, the script quits if it + cannot get a safe temporary file. TMPFILE=`mktemp /tmp/example.XXXXXX` if [ -z "$TMPFILE" ]; then exit 1; fi - echo "program output" >> $TMPFILE + printf "program output\n" >> "$TMPFILE" Example 2: Using mktemp to Support TMPDIR - - - - -SunOS 5.10 Last change: 4 Jun 2004 2 - - - - - - -User Commands mktemp(1) - - - The following example uses mktemp to support for a user's TMPDIR environment variable: - TMPFILE=`mktemp -t example.XXXXXX` - if [ -z "$TMPFILE" ]; then exit 1; fi - echo "program output" >> $TMPFILE + TMPFILE=$(mktemp -t example.XXXXXX) || exit 1 + if [[ -z $TMPFILE ]]; then exit 1; fi + printf "program output\n" >> "$TMPFILE" Example 3: Using mktemp Without Specifying the Name of the Temporary File @@ -151,9 +100,9 @@ name of the temporary file. In this case the -t flag is implied. - TMPFILE=`mktemp` - if [ -z "$TMPFILE" ]; then exit 1; fi - echo "program output" >> $TMPFILE + TMPFILE=$(mktemp) || exit 1 + if [[ -z "$TMPFILE" ]]; then exit 1; fi + printf "program output\n" >> "$TMPFILE" Example 4: Using mktemp with a Default Temporary Directory Other than /tmp @@ -162,9 +111,9 @@ /extra/tmp unless the user's TMPDIR environment variable specifies otherwise: - TMPFILE=`mktemp -p /extra/tmp example.XXXXX` - if [ -z "$TMPFILE" ]; then exit 1; fi - echo "program output" >> $TMPFILE + TMPFILE=$(mktemp -p /extra/tmp example.XXXXX) || exit 1 + if [[ -z "$TMPFILE" ]]; then exit 1; fi + printf "program output\n" >> "$TMPFILE" Example 5: Using mktemp to Remove a File @@ -172,11 +121,11 @@ files. If creation of the second temporary file fails, mktemp removes the first file before exiting: - TMP1=`mktemp -t example.1.XXXXXX` - if [ -z "$TMP1" ]; then exit 1; fi - TMP2=`mktemp -t example.2.XXXXXX` - if [ -z "$TMP2" ]; then - rm -f $TMP1 + TMP1=$(mktemp -t example.1.XXXXXXXXXX) + if [[ -z $TMP1 ]]; then exit 1; fi + TMP2=$(mktemp -t example.2.XXXXXXXXXX) + if [[ -z $TMP2 ]]; then + rm -f "$TMP1" exit 1 fi @@ -185,34 +134,24 @@ The following example does not exit if mktemp is unable to create the file. That part of the script has been protected. - TMPFILE=`mktemp -q -t example.XXXXXX` - if [ ! -z "$TMPFILE" ] + TMPFILE=$(mktemp -q -t example.XXXXXXXXXX) + if [[ ! -z $TMPFILE ]] then # Safe to use $TMPFILE in this block - - -SunOS 5.10 Last change: 4 Jun 2004 3 - - - - - - -User Commands mktemp(1) - - - - echo data > $TMPFILE + printf "%s\n" data > "$TMPFILE" ... - rm -f $TMPFILE + rm -f "$TMPFILE" fi + ENVIRONMENT VARIABLES See environ(5) for descriptions of the following environment variables that affect the execution of mktemp with the -t + option: TMPDIR. + EXIT STATUS The following exit values are returned: @@ -225,8 +164,8 @@ ATTRIBUTES - See attributes(5) for descriptions of the following attri- - butes: + See attributes(5) for descriptions of the following + attributes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | @@ -233,30 +172,26 @@ |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________| - | Interface Stability | Evolving | + | CSI | Enabled | |_____________________________|_____________________________| + | Interface Stability | Commited | + |_____________________________|_____________________________| SEE ALSO - sh(1), mkstemp(3C), mktemp(3C), attributes(5), environ(5) + sh(1), ksh93(1), mkdtemp(3C), mkstemp(3C), mktemp(3C), + attributes(5), environ(5) + NOTES - The mktemp utility appeared in OpenBSD 2.1. The Solaris - implementation uses only as many `Xs' as are significant for - mktemp(3C) and mkstemp(3C). + It is STRONGLY recommended that scripts/applications which use more + than one temporary file during runtime create a directory for the + temporary files. + The mktemp utility appeared in OpenBSD 2.1. The current + implementation is based on the AT&T AST version of "mktemp" - - - - - - - - - - SunOS 5.10 Last change: 4 Jun 2004 4 --- pathchk.1.old.txt Thu Jul 23 07:14:28 2009 +++ pathchk.1.new.txt Thu Jul 23 07:14:28 2009 @@ -9,73 +9,58 @@ pathchk - check path names SYNOPSIS - pathchk [-p] path... + /usr/bin/pathchk + /usr/bin/pathchk [ options ] pathname -DESCRIPTION - The pathchk command will check that one or more path names - are valid (that is, they could be used to access or create a - file without causing syntax errors) and portable (that is, - no filename truncation will result). More extensive porta- - bility checks are provided by the -p option. + + ksh93 + pathchk [ options ] pathname - By default, pathchk will check each component of each path - operand based on the underlying file system. A diagnostic - will be written for each path operand that: - o is longer than PATH_MAX bytes. +DESCRIPTION + pathchk checks each pathname to see if it is valid and/or + portable. A pathname is valid if it can be used to access or + create a file without causing syntax errors. A file is portable, + if no truncation will result on any conforming POSIX.1 + implementation. - o contains any component longer than NAME_MAX bytes in - its containing directory + By default pathchk checks each component of each pathname based + on the underlying file system. A diagnostic is written to + standard error for each pathname that: + - Is longer than $(getconf PATH_MAX) bytes. + - Contains any component longer than $(getconf NAME_MAX) + bytes. + - Contains any directory component in a directory that is + not searchable. + - Contains any character in any component that is not valid + in its containing directory. + - Is empty. - o contains any component in a directory that is not - searchable - o contains any character in any component that is not - valid in its containing directory. - - The format of the diagnostic message is not specified, but - will indicate the error detected and the corresponding path - operand. - - It will not be considered an error if one or more components - of a path operand do not exist as long as a file matching - the path name specified by the missing components could be - created that does not violate any of the checks specified - above. - OPTIONS - The following option is supported: + The following options is supported: - -p Instead of performing checks based on the underly- - ing file system, write a diagnostic for each path - operand that: + -p, --portability + Instead of performing length checks on the + underlying file system, write a diagnostic for + each pathname operand that: + - Is longer than $(getconf _POSIX_PATH_MAX) + bytes. + - Contains any component longer than + $(getconf _POSIX_NAME_MAX) bytes. + - Contains any character in any component + that is not in the portable filename + character set. + - Is empty. + -P + Write a diagnostic for each pathname operand that: + - Contains a component whose first character is + the character + - Is empty - o is longer than _POSIX_PATH_MAX bytes - o contains any component longer than - _POSIX_NAME_MAX bytes - - - - -SunOS 5.10 Last change: 1 Feb 1995 1 - - - - - - -User Commands pathchk(1) - - - - o contains any character in any component that - is not in the portable filename character set. - - - OPERANDS The following operand is supported: @@ -82,25 +67,23 @@ path A path to be checked. - USAGE See largefile(5) for the description of the behavior of pathchk when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). + EXAMPLES Example 1: Using the pathchk command To verify that all paths in an imported data interchange - archive are legitimate and unambiguous on the current sys- - tem: + archive are legitimate and unambiguous on the current system: example% pax -f archive | sed -e '/ == .*/s///' | xargs pathchk - if [ $? -eq 0 ] - then + if (( $? == 0 )) ; then pax -r -f archive else - echo Investigate problems before importing files. + printf "Investigate problems before importing files.\n" exit 1 fi @@ -109,11 +92,10 @@ specification that also supports the pax(1) command: example% find . -print | xargs pathchk -p - if [ $? -eq 0 ] - then + if (( $? == 0 )) ; then pax -w -f archive . else - echo Portable archive cannot be created. + printf "Portable archive cannot be created.\n" exit 1 fi @@ -122,21 +104,6 @@ given path without truncation and without overwriting any existing file: - - - - -SunOS 5.10 Last change: 1 Feb 1995 2 - - - - - - -User Commands pathchk(1) - - - example% case $- in *C*) reset="";; *) reset="set +C" @@ -144,9 +111,9 @@ esac test -r "$path" && pathchk "$path.out" && rm "$path.out" > "$path.out" - if [ $? -ne 0 ]; then + if (( $? != 0 )) ; then printf "%s: %s not found or %s.out fails \ - creation checks.\n" $0 "$path" "$path" + creation checks.\n" "$0" "$path" "$path" $reset # reset the noclobber option in case a trap # on EXIT depends on it exit 1 @@ -163,9 +130,8 @@ 2. The state of the noclobber option is unknown when this code is invoked and should be set on exit to the state - it was in when this code was invoked. (The reset vari- - able is used in this example to restore the initial - state.) + it was in when this code was invoked. (The reset variable + is used in this example to restore the initial state.) 3. Note the usage of: @@ -175,8 +141,8 @@ a. The pathchk command has already verified, at - this point, that $path.out will not be trun- - cated. + this point, that $path.out will not be + truncated. @@ -191,18 +157,6 @@ create the file again in the PROCESSING step. - -SunOS 5.10 Last change: 1 Feb 1995 3 - - - - - - -User Commands pathchk(1) - - - d. If the PROCESSING step wants the file to exist already when it is invoked, the: @@ -219,13 +173,12 @@ PROCESSING. - - ENVIRONMENT VARIABLES See environ(5) for descriptions of the following environment variables that affect the execution of pathchk: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH. + EXIT STATUS The following exit values are returned: @@ -236,10 +189,9 @@ >0 An error occurred. - ATTRIBUTES - See attributes(5) for descriptions of the following attri- - butes: + See attributes(5) for descriptions of the following + attributes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | @@ -246,17 +198,20 @@ |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________| - | Interface Stability | Standard | + | CSI | enabled | |_____________________________|_____________________________| + | Interface Stability | Commited | + |_____________________________|_____________________________| + This command conforms to IEEE Std 1003.1-2008. + SEE ALSO - pax(1), test(1), attributes(5), environ(5), largefile(5), - standards(5) + getconf(1), ksh93(1), pax(1), test(1), creat(2), pathchk(2), + attributes(5), environ(5), largefile(5), standards(5), + http://www.opengroup.org/onlinepubs/9699919799/utilities/pathchk.html - - SunOS 5.10 Last change: 1 Feb 1995 4 --- tty.1.old.txt Tue Jul 7 04:52:26 2009 +++ tty.1.new.txt Thu Jul 23 07:14:28 2009 @@ -8,84 +8,78 @@ NAME tty - return user's terminal name + SYNOPSIS - tty [-l] [-s] + /usr/bin/tty + /usr/bin/tty [ options ] + + ksh93 + tty [ options ] + + DESCRIPTION - The tty utility writes to the standard output the name of - the terminal that is open as standard input. The name that - is used is equivalent to the string that would be returned - by the ttyname(3C) function. + tty writes the name of the terminal that is connected to + not a standard input onto standard output. If the standard + input is terminal, "not a tty" will be written to standard + output. + OPTIONS The following options are supported: - -l Prints the synchronous line number to which the - user's terminal is connected, if it is on an active - synchronous line. + -l, --line-number + Write the synchronous line number of the terminal + on a separate line following the terminal name + line. If the standard input is not a synchronous + terminal then "not on an active synchronous line" + is written. + -s, --silent|quiet + Disable the terminal name line. Portable + applications should use test -t 0 or [[ -t 0 ]] + instead. - -s Inhibits printing of the terminal path name, allow- - ing one to test just the exit status. - - ENVIRONMENT VARIABLES See environ(5) for descriptions of the following environment variables that affect the execution of tty: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH. + EXIT STATUS The following exit values are returned: - 0 Standard input is a terminal. + 0 Standard input is a tty. + 1 Standard input is not a tty. + 2 Invalid arguments. + >=3 A an error occurred. - - 1 Standard input is not a terminal. - - - - >1 An error occurred. - - - ATTRIBUTES - See attributes(5) for descriptions of the following attri- - butes: + See attributes(5) for descriptions of the following + attributes: + ___________________________________________________________ + | ATTRIBUTE TYPE | ATTRIBUTE VALUE | + |_____________________________|____________________________| + | Availability | SUNWcsu | + |_____________________________|____________________________| + | CSI | enabled | + |_____________________________|____________________________| + | Interface Stability | Commited | + |_____________________________|____________________________| + This command conforms to IEEE Std 1003.1-2008. - - -SunOS 5.10 Last change: 1 Feb 1995 1 - - - - - - -User Commands tty(1) - - - - ____________________________________________________________ - | ATTRIBUTE TYPE | ATTRIBUTE VALUE | - |_____________________________|_____________________________| - | Availability | SUNWcsu | - |_____________________________|_____________________________| - | CSI | enabled | - |_____________________________|_____________________________| - | Interface Stability | Standard | - |_____________________________|_____________________________| - - SEE ALSO - isatty(3C), ttyname(3C), attributes(5), environ(5), stan- - dards(5) + ksh93(1), test(1), isatty(3C), ttyname(3C), attributes(5), + environ(5), standards(5), + http://www.opengroup.org/onlinepubs/9699919799/utilities/tty.html + DIAGNOSTICS not on an active synchronous line @@ -92,8 +86,6 @@ The standard input is not a synchronous terminal and -l is specified. - - not a tty The standard input is not a terminal and -s is not @@ -104,28 +96,9 @@ NOTES The -s option is useful only if the exit status is wanted. It does not rely on the ability to form a valid path name. - Portable applications should use test -t. + Portable applications should use test -t or [[ -t 0 ]]. - - - - - - - - - - - - - - - - - - - SunOS 5.10 Last change: 1 Feb 1995 2