pwd – return working directory nameSee attributes5 for descriptions of the following attributes: cd1, ksh1, sh1, shell_builtins1, attributes5, environ5 ‘‘Cannot open ..’’ and ‘‘Read erro
Trang 1■ the -r option is specified and no version requirements are found;
■ neither the -d nor -r option is specified and no version definitions or versionrequirements are found
See attributes(5) for descriptions of the following attributes:
ld(1), ldd(1), strip(1), elf(3ELF), attributes(5)
Linker and Libraries Guide
pvs(1)
ATTRIBUTES
SEE ALSO
Trang 2pwd – return working directory name
See attributes(5) for descriptions of the following attributes:
cd(1), ksh(1), sh(1), shell_builtins(1), attributes(5), environ(5)
‘‘Cannot open ’’ and ‘‘Read error in ’’ indicate possible file system troubleand should be referred to a UNIX system administrator
If you move the current directory or one above it, pwd may not give the correctresponse Use the cd(1) command with a full path name to correct this situation
Trang 3ranlib – convert archives to random libraries
/usr/ccs/bin/ranlib archive
The ranlib utility was used in SunOS 4.x to add a table of contents to archive
libraries, which converted each archive to a form that could be linked more rapidly.This is no longer needed, as the ar(1) command automatically provides all thefunctionality ranlib used to provide
This script is provided as a convenience for software developers who need to maintainMakefiles that are portable across a variety of operating systems
ranlibhas exit status 0
See attributes(5) for descriptions of the following attributes:
Trang 4rcp – remote file copy
rcp [-p] filename1 filename2
rcp [-pr] filename… directory
The rcp command copies files between machines Each filename or directory argument
is either a remote file name of the form:
hostname:pathor a local file name (containing no ":" (colon) characters, or "/" (backslash)
before any ":" (colon) characters)
The hostname can be an IPv4 or IPv6 address string See inet(7P) and inet6(7P) Since IPv6 addresses already contain colons, the hostname should be enclosed in a pair
of square brackets when an IPv6 address is used Otherwise, the first occurrence of a
colon can be interpreted as the separator between hostname and path For example,
[1080::8:800:200C:417A]:tmp/file
If a filename is not a full path name, it is interpreted relative to your home directory on
hostname A path on a remote host may be quoted using \ , " , or ’ , so that the
metacharacters are interpreted remotely
rcpdoes not prompt for passwords; your current local user name must exist on
hostname and allow remote command execution by rsh(1).
rcphandles third party copies, where neither source nor target files are on the currentmachine Hostnames may also take the form
username@hostname:filenameto use username rather than your current local user name as the
user name on the remote host rcp also supports Internet domain addressing of theremote host, so that:
username@host.domain:filenamespecifies the username to be used, the hostname, and the
domain in which that host resides File names that are not full path names will be
interpreted relative to the home directory of the user named username, on the remote
host
The following options are supported:
-p Attempts to give each copy the same modification times, access times,
modes, and ACLs if applicable as the original file
-r Copies each subtree rooted at filename; in this case the destination must be a
Trang 5$HOME/.profileSee attributes(5) for descriptions of the following attributes:
example% rcp tmp/file myhost:/tmp/fileresults in a severely corrupted file
rcpmay not correctly fail when the target of a copy is a file instead of a directory.rcpcan become confused by output generated by commands in a $HOME/.profile
on the remote host
rcprequires that the source host have permission to execute commands on the remotehost when doing third-party copies
rcpdoes not properly handle symbolic links Use tar or cpio piped to rsh to obtainremote copies of directories containing symbolic links or named pipes See tar(1) andcpio(1)
If you forget to quote metacharacters intended for the remote host, you will get anincomprehensible error message
rcpwill fail if you copy ACLs to a file system that does not support ACLs
rcpis CSI-enabled except for the handling of username, hostname, and domain
Trang 6rdist – remote file distribution program
rdist [-b] [-D] [-h] [-i] [-n] [-q] [-R] [-v] [-w] [-y] [-d macro = value] [-f distfile] [-m host]…
rdist [-b] [-D] [-h] [-i] [-n] [-q] [-R] [-v] [-w] [-y] -c pathname…
[login @] hostname [: destpath]
The rdist utility maintains copies of files on multiple hosts It preserves the owner,group, mode, and modification time of the master copies, and can update programsthat are executing (Note: rdist does not propagate ownership or mode changeswhen the file contents have not changed.) Normally, a copy on a remote host isupdated if its size or modification time differs from the original on the local host.(With the -y option (younger mode), only the modification times are checked, not thesize See OPTIONS below.)
There are two forms of the rdist command In the first form shown in the SYNOPSIS
section above, rdist reads the indicated distfile for instructions on updating files and/or directories If distfile is ‘−’, the standard input is used If no -f option is
present, rdist first looks in its working directory for distfile, and then forDistfile, for instructions
The second form shown in SYNOPSIS uses the -c option and specifies paths ascommand line options
In order to be able to use rdist across machines, each host machine must have a/etc/host.equivfile, or the user must have an entry in the rhosts file in thehome directory See hosts.equiv(4) for more information
The following options are supported:
-bBinary comparison Performs a binary comparison and updates files if they differ,rather than merely comparing dates and sizes
-cpathname [login @]hostname[:destpath ]
Copies each pathname to the named host; if destpath is specified, it will not update any pathname on the named host (Relative filenames are taken as relative to your home directory.) If the ‘login @’ prefix is given, the update is performed with the user ID of login If the ‘:destpath’ is given, the remote file is installed as that
Trang 7Younger mode Does not update remote copies that are younger than the mastercopy, but issues a warning message instead Only modification times are checked
No comparison of size is made
NEWLINE, TAB, and SPACE characters are all treated as white space; a mapping
continues across input lines until the start of the next mapping: either a single filename
followed by a ‘->’ or the opening parenthesis of a filename list
Comments begin with # and end with a NEWLINE
rdist(1)
White Space
Characters
Comments
Trang 8The distfile contains a sequence of entries that specify the files to be copied, thedestination files to be copied, the destination hosts, and what operations to perform to
do the updating Each entry has one of the following formats:
variable_name ’=’ name_list
[ label: ] source_list ’->’ destination_list command_list
[ label: ] source_list ’::’ time_stamp_file command_listThe first format is used for defining
variables The second format is used for distributing files to other hosts The thirdformat is used for making lists of files that have been changed since some given date.The source list specifies a list of files and/or directories on the local host that are to beused as the master copy for distribution The destination list is the list of hosts towhich these files are to be copied Each file in the source list is added to a list ofchanges if the file is out of date on the host that is being updated (second format) or ifthe file is newer than the time stamp file (third format) Labels are optional They areused to identify a command for partial updates The colon (:) is used after an optionallabel, while the double colon (::) is used for making lists of files that have been
changed since a certain date (specified by the date/time of the time_stamp file).
Typically, only notify is used with the ’::’ format of the command line
rdisthas a limited macro facility Macros are only expanded in filename or hostnamelists, and in the argument lists of certain primitives Macros cannot be used to standfor primitives or their options, or the ‘->’ or ‘::’ symbols
A macro definition is a line of the form:
The ~ character is also expanded in the same way as with csh; however, it isexpanded separately on the local and destination hosts
File names that do not begin with ‘ / ’ or ‘ ~ ’ are taken to be relative to user’s home
directory on each destination host; they are not relative to the current working
directory Multiple file names must be enclosed within parentheses
The following primitives can be used to specify actions rdist is to take whenupdating remote copies of each file
Trang 9install[-b] [-h] [-i] [-R] [-v] [-w] [-y] [newname]
Copy out of date files and directories (recursively) If no newname operand is given,
the name of the local file is given to the remote host’s copy If absent from theremote host, parent directories in a filename’s path are created To help preventdisasters, a non-empty directory on a target host is not replaced with a regular file
or a symbolic link by rdist However, when using the -R option, a non-emptydirectory is removed if the corresponding filename is completely absent on themaster host
The options for install have the same semantics as their command linecounterparts, but are limited in scope to a particular map The login name used onthe destination host is the same as the local host unless the destination name is of
the format login@host In that case, the update is performed under the username
login.
notifyaddress
Send mail to the indicated email address of the form:
user@host
that lists the files updated and any errors that may have occurred If an address
does not contain a ‘@host ’ suffix, rdist uses the name of the destination host to
complete the address
exceptfilename
Omit from updates the files named as arguments
except_patpattern
Omit from updates the filenames that match each regular-expression pattern (see
ed(1) for more information on regular expressions) Note that ‘\’ and ‘$’
characters must be escaped in the distfile Shell variables can also be used within apattern, however shell filename expansion is not supported
special[filename] "command-line "
Specify a Bourne shell, sh(1) command line to execute on the remote host after each
named file is updated If no filename argument is present, the command-line is
performed for every updated file, with the shell variable FILE set to the file’s name
on the local host The quotation marks allow command-line to span input lines in the
distfile; multiple shell commands must be separated by semicolons (;)
The default working directory for the shell executing each command-line is the user’s
home directory on the remote host
The rdist command is IPv6–enabled See ip6(7P)
EXAMPLE 1A sample distfile
The following sample distfile instructs rdist to maintain identical copies of a sharedlibrary, a shared-library initialized data file, several include files, and a directory, onhosts named hermes and magus On magus, commands are executed as super-user
rdist(1)
IPv6
EXAMPLES
Trang 10EXAMPLE 1A sample distfile (Continued)
rdistnotifies merlin@druid whenever it discovers that a local file has changedrelative to a timestamp file (Parentheses are used when the source or destination listcontains zero or more names separated by white-space.)
HOSTS = ( hermes root@magus )
FILES = ( /usr/local/lib/libcant.so.1.1
/usrlocal/lib/libcant.sa.1.1 /usr/local/include/{*.h}
/usr/local/bin )
(${FILES}) -> (${HOSTS}) install −R ;
${FILES} :: /usr/local/lib/timestamp
notify merlin@druid ;
~/.rhosts user’s trusted hosts and users/etc/host.equiv system trusted hosts and users/tmp/rdist* temporary file for update listsSee attributes(5) for descriptions of the following attributes:
csh(1), ed(1), make(1S), sh(1), stat(2), hosts.equiv(4), attributes(5), ip6(7P)
A complaint about mismatch of rdist version numbers may really stem from someproblem with starting your shell, for example, you are in too many groups
The super-user does not have its accustomed access privileges on NFS mounted filesystems Using rdist to copy to such a file system may fail, or the copies may beowned by user “nobody”
Source files must reside or be mounted on the local host
There is no easy way to have a special command executed only once after all files in adirectory have been updated
Variable expansion only works for name lists; there should be a general macro facility.rdistaborts on files that have a negative modification time (before Jan 1, 1970).There should be a “force” option to allow replacement of non-empty directories byregular files or symlinks A means of updating file modes and owners of otherwiseidentical files is also needed
Trang 11read – read a line from standard input
/usr/bin/read [-r] var…
read name…
set variable = $<
read [-prsu [n]] [name ? prompt] [name…]
The read utility will read a single line from standard input
By default, unless the -r option is specified, backslash (\) acts as an escape character
If standard input is a terminal device and the invoking shell is interactive, read willprompt for a continuation line when:
■ The shell reads an input line ending with a backslash, unless the -r option isspecified
■ A here-document is not terminated after a newline character is entered
The line will be split into fields as in the shell; the first field will be assigned to the first
variable var, the second field to the second variable var, and so forth If there are fewer
var operands specified than there are fields, the leftover fields and their intervening
separators will be assigned to the last var If there are fewer fields than vars, the remaining vars will be set to empty strings.
The setting of variables specified by the var operands will affect the current shell
execution environment If it is called in a subshell or separate utility executionenvironment, such as one of the following:
(read foo) nohup read
find -exec read \;
it will not affect the shell variables in the caller’s environment
The standard input must be a text file
One line is read from the standard input and, using the internal field separator, IFS(normally space or tab), to delimit word boundaries, the first word is assigned to the
first name, the second word to the second name, etc., with leftover words assigned to the last name Lines can be continued using \newline Characters other than
newlinecan be quoted by preceding them with a backslash These backslashes are
removed before words are assigned to names, and no interpretation is done on the
character that follows the backslash The return code is 0, unless an EOF isencountered
Trang 12The shell input mechanism One line is read and is broken up into fields using thecharacters in IFS as separators The escape character, (\), is used to remove anyspecial meaning for the next character and for line continuation In raw mode, -r, the
\character is not treated specially The first field is assigned to the first name, the second field to the second name, etc., with leftover fields assigned to the last name The
-poption causes the input line to be taken from the input pipe of a process spawned
by the shell using |& If the -s flag is present, the input will be saved as a command in
the history file The flag -u can be used to specify a one digit file descriptor unit n to
read from The file descriptor can be opened with the exec special command The
default value of n is 0 If name is omitted then REPLY is used as the default name The
exit status is 0 unless the input file is not open for reading or an end-of-file isencountered An end-of-file with the -p option causes cleanup for this process so thatanother can be spawned If the first argument contains a ?, the remainder of this word
is used as a prompt on standard error when the shell is interactive The exit status is 0
unless an end-of-file is encountered
The following option is supported:
-r Do not treat a backslash character in any special way Consider each
backslash to be part of the input line
The following operand is supported:
var The name of an existing or non-existing shell variable
EXAMPLE 1An example of the read command
The following example for /usr/bin/read prints a file with the first field of eachline moved to the end of the line
while read -r xx yy do
printf "%s %s\n" "$yy" "$xx"
done < input_file
See environ(5) for descriptions of the following environment variables that affect theexecution of read: LC_CTYPE, LC_MESSAGES, and NLSPATH
IFS Determine the internal field separators used to delimit fields
PS2 Provide the prompt string that an interactive shell will write to standard
error when a line ending with a backslash is read and the -r option wasnot specified, or if a here-document is not terminated after a newlinecharacter is entered
The following exit values are returned:
0 Successful completion
>0 End-of-file was detected or an error occurred
See attributes(5) for descriptions of the following attributes:
Trang 13ATTRIBUTE TYPE ATTRIBUTE VALUE
csh(1), ksh(1), line(1), set(1), sh(1), attributes(5), environ(5)
read(1)
SEE ALSO
Trang 14readfile, longline – reads file, gets longest line
readfile filename
longline [filename]
The readfile function reads filename and copies it to stdout No translation of
NEWLINE is done It keeps track of the longest line it reads and if there is asubsequent call to longline, the length of that line, including the NEWLINEcharacter, is returned
The longline function returns the length, including the NEWLINE character, of the
longest line in filename If filename is not specified, it uses the file named in the last call
to readfile
EXAMPLE 1Typical use of readfile and longlineHere is a typical use of readfile and longline in a text frame definition file:
text="‘readfile myfile‘"
columns=‘longline‘
.
See attributes(5) for descriptions of the following attributes:
cat(1), attributes(5)
If filename does not exist, readfile will return FALSE (that is, the expression will
have an error return)
longlinereturns 0 if a readfile has not previously been issued
More than one descriptor can call readfile in the same frame definition file In textframes, if one of those calls is made from the text descriptor, then a subsequent use
of longline will always get the longest line of the file read by the readfileassociated with the text descriptor, even if it was not the most recent use ofreadfile
Trang 15readonly – shell built-in function to protect the value of the given variable fromreassignment
readonly [name…]
**readonly [name [= value]…]
The given names are marked readonly and the values of the these names may not be
changed by subsequent assignment If no arguments are given, a list of all readonlynames is printed
The given names are marked readonly and these names cannot be changed by
2 I/O redirections are processed after variable assignments
3 Errors cause a script that contains them to abort
4 Words, following a command preceded by ** that are in the format of a variableassignment, are expanded with the same rules as a variable assignment Thismeans that tilde substitution is performed after the = sign and word splitting andfile name generation are not performed
See attributes(5) for descriptions of the following attributes:
Trang 16refer – expand and insert references from a bibliographic database
refer [-ben] [-ar] [-cstring] [-kx] [-lm,n] [-p filename] [-skeys]
filename…
referis a preprocessor for nroff(1), or troff(1), that finds and formats references.The input files (standard input by default) are copied to the standard output, exceptfor lines between ‘ [’ and ‘ ]’ command lines, Such lines are assumed to containkeywords as for lookbib(1), and are replaced by information from a bibliographicdata base The user can avoid the search, override fields from it, or add new fields Thereference data, from whatever source, is assigned to a set of troff strings Macropackages such as ms(5) print the finished reference text from these strings A flag isplaced in the text at the point of reference By default, the references are indicated bynumbers
When refer is used with eqn(1), neqn, or tbl(1), refer should be used first in thesequence, to minimize the volume of data passed through pipes
-b Bare mode — do not put any flags in text (neither numbers or
labels)
-e Accumulate references instead of leaving the references where
encountered, until a sequence of the form:
-n Do not search the default file
-ar Reverse the first r author names (Jones, J A instead of J A Jones).
If r is omitted, all author names are reversed.
-cstring Capitalize (with SMALL CAPS) the fields whose key-letters are in
string.
-kx Instead of numbering references, use labels as specified in a
reference data line beginning with the characters %x; By default, x
is L
-lm,n Instead of numbering references, use labels from the senior
author’s last name and the year of publication Only the first m letters of the last name and the last n digits of the date are used If either of m or n is omitted, the entire name or date, respectively, is
used
-pfilename Take the next argument as a file of references to be searched The
default file is searched last
Trang 17-skeys Sort references by fields whose key-letters are in the keys string,
and permute reference numbers in the text accordingly Using this
option implies the -e option The key-letters in keys may be
followed by a number indicating how many such fields are used,with a + sign taken as a very large number The default is AD,which sorts on the senior author and date To sort on all authorsand then the date, for instance, use the options ‘-sA+T’
/usr/lib/refer directory of programs/usr/lib/refer/papers directory of default publication lists and indexesSee attributes(5) for descriptions of the following attributes:
Trang 18regcmp – regular expression compile
regcmp [-] filename…
The regcmp command performs a function similar to regcmp and, in most cases,precludes the need for calling regcmp from C programs Bypassing regcmp saves onboth execution time and program size The command regcmp compiles the regular
expressions in filename and places the output in filename.i.
− If the− option is used, the output is placed in filename.c The format of
entries in filename is a name (C variable) followed by one or more blanks
followed by one or more regular expressions enclosed in double quotes.The output of regcmp is C source code Compiled regular expressions are
represented as extern char vectors filename.i files may thus be
#included in C programs, or filename.c files may be compiled and later
loaded In the C program that uses the regcmp output,regex(abc,line)applies the regular expression named abc to line.Diagnostics are self-explanatory
EXAMPLE 1Examples of the regcmp command
name "([A−Za−z][A−Za−z0−9_]*)$0"
telno " \({0,1}([2−9][01][1−9])$0\){0,1} *"
"([2−9][0−9]{2})$1[ −]{0,1}"
"([0−9]{4})$2"
The three arguments to telno shown above must all be entered on one line
In the C program that uses the regcmp output,regex(telno, line, area, exch, rest)applies the regular expression named telno to line
A general description of the usage of the LC_* environmental variables can be found
in environ(5)
LC_CTYPE Determines how regcmp handles characters When LC_CTYPE is
set to a valid value, regcmp can display and handle text andfilenames containing valid characters for that locale
LC_MESSAGES Determines how diagnostic and informative messages are
presented This includes the language and style of the messages,and the correct form of affirmative and negative responses In the
"C" locale, the messages are presented in the default form found inthe program itself (in most cases, U.S English)
See attributes(5) for descriptions of the following attributes:
Trang 19ATTRIBUTE TYPE ATTRIBUTE VALUE
Trang 20regex – match patterns against a string
regex [-e] [-v "string"] [pattern template] … pattern [template]
The regex command takes a string from the standard input, and a list of pattern /
template pairs, and runs regex() to compare the string against each pattern until there
is a match When a match occurs, regex writes the corresponding template to the standard output and returns TRUE The last (or only) pattern does not need a template.
If that is the pattern that matches the string, the function simply returns TRUE If nomatch is found, regex returns FALSE
The argument pattern is a regular expression of the form described in regex() In most cases, pattern should be enclosed in single quotes to turn off special meanings of characters Note that only the final pattern in the list may lack a template.
The argument template may contain the strings $m0 through $m9, which will be expanded to the part of pattern enclosed in ( )$0 through ( )$9
constructs (see examples below) Note that if you use this feature, you must be sure to
enclose template in single quotes so that FMLI does not expand $m0 through $m9 at
parse time This feature gives regex much of the power of cut(1), paste(1), andgrep(1), and some of the capabilities of sed(1) If there is no template, the default is
$m0$m1$m2$m3$m4$m5$m6$m7$m8$m9.The following options are supported:
-e Evaluates the corresponding template and writes the result to the
standard output
-v"string" Uses string instead of the standard input to match against patterns.
EXAMPLE 1Cutting letters out of a string
To cut the 4th through 8th letters out of a string (this example will output strin andreturn TRUE):
‘regex -v "my string is nice" ’^.{3}(.{5})$0’ ’$m0’‘
EXAMPLE 2Validating input in a form
In a form, to validate input to field 5 as an integer:
valid=‘regex -v "$F5" ’^[0-9]+$’‘
EXAMPLE 3Translating an environment variable in a form
In a form, to translate an environment variable which contains one of the numbers 1,
2, 3, 4, 5 to the letters a, b, c, d, e:
value=‘regex -v "$VAR1" 1 a 2 b 3 c 4 d 5 e ’.*’ ’Error’‘
Note the use of the pattern ’.*’ to mean "anything else"
Trang 21EXAMPLE 4Using backquoted expressions
In the example below, all three lines constitute a single backquoted expression Thisexpression, by itself, could be put in a menu definition file Since backquotedexpressions are expanded as they are parsed, and output from a backquotedexpression (the cat command, in this example) becomes part of the definition filebeing parsed, this expression would read /etc/passwd and make a dynamic menu
of all the login ids on the system
‘cat /etc/passwd | regex ’^([^:]*)$0.*$’ ’ name=$m0
action=‘message "$m0 is a user"‘’‘
If none of the patterns match, regex returns FALSE, otherwise TRUE
Patterns and templates must often be enclosed in single quotes to turn off the specialmeanings of characters Especially if you use the $m0 through $m9 variables in thetemplate, since FMLI will expand the variables (usually to "") before regex even seesthem
Single characters in character classes (inside [ ]) must be listed before characterranges, otherwise they will not be recognized For example, [a-zA-Z_/] will not findunderscores (_) or slashes (/), but [_/a-zA-Z] will
The regular expressions accepted by regcmp differ slightly from other utilities (that is,sed, grep, awk, ed, and so forth)
regexwith the -e option forces subsequent commands to be ignored In other words,
if a backquoted statement appears as follows:
‘regex -e ; command1; command2‘
command1and command2 would never be executed However, dividing theexpression into two:
‘regex -e ‘‘command1; command2‘
would yield the desired result
See attributes(5) for descriptions of the following attributes:
Trang 22reinit – runs an initialization file
valid FMLI initialization file
The reinit command does not re-display the introductory frame or change thelayout of screen labels for function keys
See attributes(5) for descriptions of the following attributes:
Trang 23renice – alter priority of running processes
renice [-n increment] [-i idtype] ID…
renice [-n increment] [-g | -p | -u]ID…
renice priority [-p] pid… [-g gid…] [-p pid…] [-u user…]
renice priority -g gid… [-g gid…] [-p pid…] [-u user…]
renice priority -u user… [-g gid…] [-p pid…] [-u user…]
The renice command alters the scheduling priority of one or more runningprocesses By default, the processes to be affected are specified by their process IDs
If the first operand is a number within the valid range of priorities (−20 to 20),renicewill treat it as a priority (as in all but the first synopsis form); otherwise,
renicewill treat it as an ID (as in the first synopsis form).
Users other than the privileged user may only alter the priority of processes they own,and can only monotonically increase their “nice value” within the range 0 to 19 Thisprevents overriding administrative fiats The privileged user may alter the priority ofany process and set the priority to any value in the range−20 to 19 Useful prioritiesare: 19 (the affected processes will run only when nothing else in the system wants to);
0(the “base” scheduling priority),; and any negative value (to make things go veryfast) 20 is an acceptable nice value, but will be rounded down to 19
renicesupports the following option features:
■ The first operand, priority, must precede the options and can have the appearance
of a multi-digit option
■ The -g, -p, and -u options can each take multiple option-arguments
■ The pid option-argument can be used without its -p option.
■ The -i option can be used to specify the ID type for the ID list This is preferred in specifying ID type over the use of the -g | -p | -u syntax, which is now obsolete.
See NOTES
The following options are supported:
-g Interprets all operands or just the gid arguments as unsigned
decimal integer process group IDs
-i This option, together with the ID list arguments, specifies a class of
processes to which the renice command is to apply The
interpretation of the ID list depends on the value of idtype The valid idtype arguments are: pid, pgid, uid, gid, sid, taskid,
and projid
-nincrement Specifies how the system scheduling priority of the specified
process or processes is to be adjusted The increment
option-argument is a positive or negative decimal integer that will
be used to modify the system scheduling priority of the specified
Trang 24process or processes Positive increment values cause a lower system scheduling priority Negative increment values may require
appropriate privileges and will cause a higher system schedulingpriority
-p Interprets all operands or just the pid arguments as unsigned
decimal integer process IDs The -p option is the default if nooptions are specified
-u Interprets all operands or just the user argument as users If a user
exists with a user name equal to the operand, then the user ID ofthat user will be used in further processing Otherwise, if theoperand represents an unsigned decimal integer, it will be used asthe numeric user ID of the user
The following operands are supported:
ID A process ID, process group ID or user name/user ID, depending
on the option selected
priority The value specified is taken as the actual system scheduling
priority, rather than as an increment to the existing systemscheduling priority Specifying a scheduling priority higher thanthat of the existing process may require appropriate privileges
EXAMPLE 1Adjusting the scheduling priority of process IDsAdjust the system scheduling priority so that process IDs 987 and 32 would have alower scheduling priority:
example% renice -n 5 -p 987 32
EXAMPLE 2Adjusting the scheduling priority of group IDsAdjust the system scheduling priority so that group IDs 324 and 76 would have ahigher scheduling priority, if the user has the appropriate privileges to do so:
example% renice -n -4 -g 324 76
EXAMPLE 3Adjusting the scheduling priority of a user ID and user nameAdjust the system scheduling priority so that numeric user ID 8 and user sas wouldhave a lower scheduling priority:
example% renice -n 4 -u 8 sas
See environ(5) for descriptions of the following environment variables that affect theexecution of renice: LC_CTYPE, LC_MESSAGES, and NLSPATH
The following exit values are returned:
Trang 25renice [-n increment] [-i idtype] ID is preferred over the old syntax
renice [-n increment] [-g | -p| -u] ID which is now obsolete.
If you make the priority very negative, then the process cannot be interrupted
To regain control you must make the priority greater than 0
Users other than the privileged user cannot increase scheduling priorities of their ownprocesses, even if they were the ones that decreased the priorities in the first place.The priocntl command subsumes the function of renice
Trang 26reset – reset the current form field to its default values
reset
The reset function changes the entry in a field of a form to its default value; that is,the value displayed when the form was opened
See attributes(5) for descriptions of the following attributes:
Trang 27rlogin – remote login
rlogin [-8EL] [-ec ] [-l username] hostname
rloginestablishes a remote login session from your terminal to the remote machine
named hostname.
Hostnames are listed in the hosts database, which may be contained in the
/etc/hostsand /etc/inet/ipnodes files, the Network Information Service (NIS)hostsmap, the Internet domain name server, or a combination of these Each hosthas one official name (the first name in the database entry), and optionally one or more
nicknames Either official hostnames or nicknames may be specified in hostname.
Each remote machine may have a file named /etc/hosts.equiv containing a list oftrusted hostnames with which it shares usernames Users with the same username onboth the local and remote machine may rlogin from the machines listed in theremote machine’s /etc/hosts.equiv file without supplying a password Individualusers may set up a similar private equivalence list with the file rhosts in their home
directories Each line in this file contains two names: a hostname and a username
separated by a space An entry in a remote user’s rhosts file permits the user
named username who is logged into hostname to log in to the remote machine as the
remote user without supplying a password If the name of the local host is not found
in the /etc/hosts.equiv file on the remote machine, and the local username andhostname are not found in the remote user’s rhosts file, then the remote machinewill prompt for a password Hostnames listed in /etc/hosts.equiv and rhostsfiles must be the official hostnames listed in the hosts database; nicknames may not beused in either of these files
For security reasons, the rhosts file must be owned by either the remote user or byroot
The remote terminal type is the same as your local terminal type (as given in yourenvironment TERM variable) The terminal or window size is also copied to the remotesystem if the server supports the option, and changes in size are reflected as well Allechoing takes place at the remote site, so that (except for delays) the remote login istransparent Flow control using CTRL-S and CTRL-Q and flushing of input and output
on interrupts are handled properly
The following options are supported:
-8 Pass eight-bit data across the net instead of seven-bit data
-ec Specify a different escape character, c, for the line used to
disconnect from the remote host
-E Stop any character from being recognized as an escape character.-lusername Specify a different username for the remote login If you do not use
this option, the remote username used is the same as your localusername
-L Allow the rlogin session to be run in “litout” mode
Trang 28Lines that you type which start with the tilde character are “escape sequences” (theescape character can be changed using the -e option):
~ Disconnect from the remote host This is not the same as a logout,
because the local host breaks the connection with no warning tothe remote end
~susp Suspend the login session (only if you are using a shell with Job
Control) susp is your “suspend” character, usually CTRL-Z; seetty(1)
~dsusp Suspend the input half of the login, but output will still be seen
(only if you are using a shell with Job Control) dsusp is your
“deferred suspend” character, usually CTRL-Y; see tty(1)
hostname The remote machine on which rlogin establishes the remote login
/etc/inet/ipnodes hosts databaseSee attributes(5) for descriptions of the following attributes:
NO LOGINS: System going down in N minutes
When a system is listed in hosts.equiv, its security must be as good as localsecurity One insecure system listed in hosts.equiv can compromise the security ofthe entire system
Trang 29The Network Information Service (NIS) was formerly known as Sun Yellow Pages(YP.) The functionality of the two remains the same; only the name has changed.This implementation can only use the TCP network service.
rlogin(1)
Trang 30rm, rmdir – remove directory entries
/usr/bin/rm [-f] [-i] file…
/usr/bin/rm -rR [-f] [-i] dirname… [file…]
/usr/xpg4/bin/rm [-fiRr] file…
/usr/bin/rmdir [-ps] dirname…
The rm utility removes the directory entry specified by each file argument If a file has
no write permission and the standard input is a terminal, the full set of permissions(in octal) for the file are printed followed by a question mark This is a prompt forconfirmation If the answer begins with y (for yes), the file is deleted, otherwise the fileremains
If file is a symbolic link, the link will be removed, but the file or directory to which it
refers will not be deleted Users do not need write permission to remove a symboliclink, provided they have write permissions in the directory
If multiple files are specified and removal of a file fails for any reason, rm will write a diagnostic message to standard error, do nothing more to the current file, and go on to any remaining files.
If the standard input is not a terminal, the utility will operate as if the -f option is ineffect
The rmdir utility will remove the directory entry specified by each dirname operand,
which must refer to an empty directory
Directories will be processed in the order specified If a directory and a subdirectory ofthat directory are specified in a single invocation of rmdir, the subdirectory must bespecified before the parent directory so that the parent directory will be empty whenrmdirtries to remove it
The following options are supported for /usr/bin/rm and /usr/xpg4/bin/rm:-r Recursively removes directories and subdirectories in the argument list
The directory will be emptied of files and removed The user is normallyprompted for removal of any write-protected files which the directorycontains The write-protected files are removed without prompting,however, if the -f option is used, or if the standard input is not a terminaland the -i option is not used
Symbolic links that are encountered with this option will not be traversed
If the removal of a non-empty, write-protected directory is attempted, theutility will always fail (even if the -f option is used), resulting in an errormessage
Trang 31The following options are supported for /usr/bin/rm only:
-f Removes all files (whether write-protected or not) in a directory without
prompting the user In a write-protected directory, however, files are neverremoved (whatever their permissions are), but no messages are displayed
If the removal of a write-protected directory is attempted, this option willnot suppress an error message
-i Interactive With this option, rm prompts for confirmation before removing
any files It overrides the -f option and remains in effect even if thestandard input is not a terminal
The following options are supported for /usr/xpg4/bin/rm only:
-f Does not prompt for confirmation Does not write diagnostic messages or
modify the exit status in the case of non-existent operands Any previousoccurrences of the -i option will be ignored
-i Prompts for confirmation Any occurrences of the -f option will be
ignored
The following options are supported for /usr/bin/rmdir only:
-p Allows users to remove the directory dirname and its parent directories
which become empty A message is printed to standard error if all or part
of the path could not be removed
-s Suppresses the message printed on the standard error when -p is in effect.The following operands are supported:
file A path name of a directory entry to be removed
dirname A path name of an empty directory to be removed
See largefile(5) for the description of the behavior of rm and rmdir whenencountering files greater than or equal to 2 Gbyte ( 231bytes)
EXAMPLE 1Removing directoriesThe following command:
example% rm a.out core
removes the directory entries a.out and core
EXAMPLE 2Removing a directory without promptingThe following command:
Trang 32EXAMPLE 2Removing a directory without prompting (Continued)
removes the directory junk and all its contents, without prompting
EXAMPLE 3Removing empty directories
If a directory a in the current directory is empty, except that it contains a directory b,and a/b is empty except that it contains a directory c,
example% rmdir -p a/b/c
will remove all three directories
See environ(5) for descriptions of the following environment variables that affect theexecution of rm and rmdir: LC_COLLATE, LC_CTYPE, LC_MESSAGES, and NLSPATH.The following exit values are returned:
0 If the -f option was not specified, all the named directory entries were
removed; otherwise, all the existing named directory entries were removed
>0 An error occurred
See attributes(5) for descriptions of the following attributes:
Trang 33A− permits the user to mark explicitly the end of any command line options, allowing
rmto recognize file arguments that begin with a− As an aid to BSD migration, rm willaccept− − as a synonym for − This migration aid may disappear in a future release If
a− − and a − both appear on the same command line, the second will be interpreted
as a file
rm(1)
NOTES
Trang 34rmformat – removable rewritable media format utility
rmformat [-DeHpUv] [-b label] [-c blockno] [-Fquick | long | force ]
[-R enable | disable ] [-s filename] [-w enable | disable] [-W
enable | disable] [devname]
rmformat -V read | write devname
The rmformat utility is used to format, label, partition, and perform othermiscellaneous functions on removable, rewritable media that include floppy drives,IOMEGA Zip/Jaz products, and the PCMCIA memory and ata cards This utility canalso be used for the verification and surface analysis and for repair of the bad sectorsfound during verification if the drive or the driver supports bad block management.rmformatprovides functionality to read/write protect the media with or without apassword The password protection enabling or disabling is possible only withselective rewritable media such as the IOMEGA Zip/Jaz products
After formatting, rmformat writes the label, which covers the full capacity of themedia as one slice on floppy and PCMCIA memory cards to maintain compatibilitywith the behavior of fdformat On Zip/Jaz devices, the driver exports one slicecovering the full capacity of the disk as default rmformat does not write the label onZip/Jaz media, unless explicitly requested The partition information can be changedwith the help of other options provided by rmformat
The following options are supported:
-blabel Labels the media with a SUNOS label A SUNOS
volume label name is restricted to 8 characters Forwriting a DOS Volume label, the user should usemkfs_pcfs(1M)
-cblockno Corrects and repairs the given block This correct and
repair option may not be applicable to all devicessupported by rmformat, as some devices may have adrive with bad block management capability andothers may have this option implemented in the driver
If the drive or driver supports bad block management,
a best effort is made to rectify the bad block If the badblock still cannot be rectified, a message is displayed toindicate the failure to repair The block number can beprovided in decimal, octal, or hexadecimal format.The normal floppy and PCMCIA memory and atacards do not support bad block management
-D Formats a 720KB (3.5 inch) double density diskette
This is the default for double density type drives Thisoption is needed if the drive is a high or
Trang 35-e Ejects the media upon completion This feature may
not be available if the drive does not supportmotorized eject
-Fquick | long | force Formats the media
The quick option starts a format without certification
or format with limited certification of certain tracks onthe media
The long option starts a complete format For somedevices this might include the certification of the wholemedia by the drive itself
The force option to format is provided to start a longformat without user confirmation before the format isstarted For drives which have a password protectionmechanism, it clears the password while formatting.This feature is useful when a password is no longeravailable On those media which do not have suchpassword protection, force starts a long format
In legacy media such as floppy drives, all options start
a long format depending on the mode (ExtendedDensity mode, High Density mode, or Double Densitymode) with which the floppy drive operates by default
On PCMCIA memory cards, all options start a longformat
-H Formats a 1.44 MB (3.5 inch) high density diskette This
is the default for high density type drives It is needed
if the drive is the Extended Density type
-p Prints the protection status of the media This option
prints information whether the media is write, read, orpassword protected
-Renable | disable Enables read/write protection with a password or
disables the password read/write protection Thisalways works in interactive mode, as the password isrequested from the user in an interactive manner tomaintain security
A password length of 32 bytes (maximum) is allowedfor the IOMEGA products that support this feature.This option is applicable only for IOMEGA products.IOMEGA products do not allow read/write protection
rmformat(1)
Trang 36without a password On the devices which do not havesuch software read/write protect facility, warningsindicating the non-availability of this feature areprovided.
-sfilename Enables the user to lay out the partition information in
the SUNOS label
The user should provide a file as input withinformation about each slice in a format providing byteoffset, size required, tags, and flags, as follows:
slices: n = offset, size [, flags, tags]
where n is the slice number, offset is the byte offset at which the slice n starts, and size is the required size for slice n Both offset and size must be a multiple of 512
bytes These numbers can be represented as decimal,hexadecimal, or octal numbers No floating pointnumbers are accepted Details about maximum number
of slices can be obtained from the SystemAdministration Guide: Basic Administration
To specify the size or offset in kilobytes, megabytes, or
gigabytes, add KB, MB, GB, respectively A numberwithout a suffix is assumed to be a byte offset The flagsare represented as follows:
wm = read-write, mountable
wu = read-write, unmountable
ru = read-only, unmountableThe tags are represented as follows: unassigned,boot, root, swap, usr, backup, stand, var, home,alternates
The tags and flags can be omitted from the four tuplewhen finer control on those values is not required It isrequired to omit both or include both If the tags andflags are omitted from the four tuple for a particularslice, a default value for each is assumed The defaultvalue for flags is wm and for tags is unassigned.Either full tag names can be provided or anabbreviation for the tags can be used The abbreviationscan be the first two or more letters from the standardtag names rmformat is case insensitive in handlingthe defined tags & flags
Slice specifications are separated by :rmformat(1)
Trang 37slice n If multiple slice information entries for the same slice n is provided, an approriate error message is
displayed The slice 2 be the backup slice covering thewhole disk capacity The pound sign character, #, can
be used to describe a line of comments in the input file
If the line starts with #, then rmformat ignores all thecharacters following # until the end of the line
Partitioning some of the media with very smallcapacity is permitted, but be cautious in using thisoption on such devices
formats See mount(1M) This option unmounts all themounted slices and issues a long format on the devicerequested
-Vread | write Verifies each block of media after format The write
verification is a destructive mechanism The user isqueried for confirmation before the verification isstarted The output of this option is a list of blocknumbers, which are identified as bad
The read verification only verifies the blocks and reportthe blocks which are prone to errors
The list of block numbers displayed can be used withthe -c option for repairing
-wenable | disable Enables or disables the write protection on media On
devices that do not have a software write protectfacility, a message indicating non-availability of thisfeature is displayed
-Wenable | disable Enables or disables write protection with password
This option always works in interactive mode, as apassword is requested from the user to maintainsecurity
rmformat(1)
Trang 38A maximum password length of 32 bytes is allowed forIOMEGA products that support this feature Ondevices that do not have the write protection withpassword, the software displays appropriate messagesindicating the non-availability of such features.
The following operands are supported:
devname devname can be provided as absolute device pathname
or relative pathname for the device from the currentworking directory or the nickname as exported by theSystem Volume manager See vold(1M)
For floppy device /dev/rdiskette0 (for systemwithout volume management) or floppy0 (systemwith volume management) can be used To use the firstdrive, specify /dev/rdiskette1 (for system withoutvolume management), or floppy1 (system withvolume management) to use the second drive
For system without volume management running, usercan also provide the absolute device pathname as/dev/rdsk/c?t?d?s? or the appropriate relative
device pathname from the current working directory
EXAMPLE 1Formatting a diskette
example$ rmformat -F quick /dev/rdiskette
Formatting will erase all the data on disk.
Do you want to continue? (y/n)y
EXAMPLE 2Formatting a Zip drive
example$ rmformat -F quick /vol/dev/aliases/zip0
Formatting will erase all the data on disk.
Do you want to continue? (y/n)y
EXAMPLE 3Formatting a diskette for a UFS file systemThe following example formats a diskette and creates a UFS file system:
example$ rmformat -F quick /vol/dev/aliases/floppy0
Formatting will erase all the data on disk.
Do you want to continue? (y/n)y example$ su
# /usr/sbin/newfs /vol/dev/aliases/floppy0 newfs: construct a new file system /dev/rdiskette: (y/n)? y
/dev/rdiskette: 2880 sectors in 80 cylinders of 2 tracks, 18 sectors
1.4MB in 5 cyl groups (16 c/g, 0.28MB/g, 128 i/g) super-block backups (for fsck -F ufs -o b=#) at:
Trang 39EXAMPLE 4Formatting removable media for a PCFS file system
The following example shows how to create an alternate fdisk partition:
example$ rmformat -F quick /dev/rdsk/c0t4d0s2:c
Formatting will erase all the data on disk.
Do you want to continue? (y/n)y
example$ rmformat -F quick /dev/rdiskette
Formatting will erase all the data on disk.
Do you want to continue? (y/n)y
example$ su
# mkfs -F pcfs -o nofdisk,size=2 /dev/rdiskette
Construct a new FAT file system on /dev/rdiskette: (y/n)? y
#
EXAMPLE 5Enabling or disabling read or write protection
The following example shows how to enable write protection and set a password on aZip drive:
example$ rmformat -W enable /vol/dev/aliases/zip0
Please enter password (32 chars maximum): xxx
Please reenter password: xxx
The following example shows how to disable write protection and remove the
password on a Zip drive:
example$ rmformat -W disable /vol/dev/aliases/zip0
Please enter password (32 chars maximum): xxx
The following example shows how to enable read protection and set a password on aZip drive:
example$ rmformat -R enable /vol/dev/aliases/zip0
Please enter password (32 chars maximum): xxx
Please reenter password: xxx
The following example shows how to disable read protection and remove the
password on a Zip drive:
example$ rmformat -R disable /vol/dev/aliases/zip0
Please enter password (32 chars maximum): xxx
/vol/dev/diskette0 Directory providing block device access for
the media in floppy drive 0
rmformat(1)
FILES
Trang 40/vol/dev/rdiskette0 Directory providing character device access
for the media in floppy drive 0
/vol/dev/aliases Directory providing symbolic links to the
character devices for the different mediaunder the control of volume managementusing appropriate alias
/vol/dev/aliases/floppy0 Symbolic link to the character device for the
media in floppy drive 0
/vol/dev/aliases/zip0 Symbolic link to the character device for the
media in Zip drive 0
/vol/dev/aliases/jaz0 Symbolic link to the character device for the
media in Jaz drive 0
/dev/rdiskette Symbolic link providing character device
access for the media in the primary floppydrive, usually drive 0
/vol/dev/dsk Directory providing block device access for
the PCMCIA memory and ata cards andremovable media devices
/vol/dev/rdsk Directory providing character device access
for the PCMCIA memory and ata cards andremovable media devices
/vol/dev/aliases/pcmemS Symbolic link to the character device for the
PCMCIA memory card in socket S, where Srepresents a PCMCIA socket number./vol/dev/aliases/rmdisk0 Symbolic link to the generic removable
media device that is not a Zip, Jaz,CD-ROM, floppy, DVD-ROM, PCMCIAmemory card, and so forth
for the PCMCIA memory and ata cards andother removable devices
the PCMCIA memory and ata cards andother removable media devices
See attributes(5) for descriptions of the following attributes:
rmformat(1)
ATTRIBUTES