The copying of lines from the standard input to the standard output is conditional,based on tests in control statements of keyword values specified in controlstatements or as vc command
Trang 1vacation – reply to mail automatically
vacation [-I]
vacation [-a alias] [-f database_file] [-j] [-m message_file] [-s sender]
[-tN] usernameThe vacation utility automatically replies to incoming mail
The installation consists of an interactive program which sets up vacation’s basicconfiguration
To install vacation, type it with no arguments on the command line The programcreates a vacation.msg file, which contains the message that is automatically sent
to all senders when vacation is enabled, and starts an editor for you to modify themessage (See USAGE section.) Which editor is invoked is determined by the VISUAL
or EDITOR environment variable, or vi(1) if neither of those environment variablesare set
A forward file is also created if one does not exist in your home directory Oncecreated, the forward file will contain a line of the form:
\username, "|/usr/bin/vacation username"One copy of an incoming message is sent to the
username and another copy is piped into vacation.
If a forward file is present in your home directory, it will ask whether you want toremove it, which disables vacation and ends the installation
The program automatically creates vacation.pag and vacation.dir, whichcontain a list of senders when vacation is enabled
The presence of the forward file determines whether or not vacation is disabled
or enabled To disable vacation, remove the forward file, or move it to a newname
The -I option clears the vacation log files, vacation.pag and vacation.dir,erasing the list of senders from a previous vacation session (See OPTIONS section.)vacationprovides configuration options that are not part of the installation, thesebeing -a, -f, -j, -m, -s, and -t (See OPTIONS section.)
The following options are supported:
-I Initializes the vacation.pag and vacation.dir files and
enables vacation If the -I flag is not specified, and a user
argument is given, vacation reads the first line from thestandard input (for a From: line, no colon) If absent, it produces
Trang 2\username, "|/usr/bin/vacation -t1m username"repeats replies to the sender everyminute.
-aalias Indicates that alias is one of the valid aliases for the user running
vacation, so that mail addressed to that alias generates a reply.-ffile Uses file instead of vacation as the base name for the database
file
-j Does not check whether the recipient appears in the To: or the
Cc:line Warning: use of this option can result in vacation repliesbeing sent to mailing lists and other inappropriate places; its use istherefore strongly discouraged
-mfile Uses file instead of vacation.msg as the message to send for
the reply
-ssender Replies to sender instead of the value read from the UNIX From
line of the incoming message
-tN Changes the interval between repeat replies to the same sender
The default is 1 week A trailing s, m, h, d, or w scales N to seconds,
minutes, hours, days, or weeks, respectively
.vacation.msgshould include a header with at least a Subject: line (it should notinclude a To: line) For example:
Subject: I am on vacation
I am on vacation until July 22 If you have something urgent,
please contact Joe Jones (jones@fB0).
John
If the string $SUBJECT appears in the vacation.msg file, it is replaced with thesubject of the original message when the reply is sent; thus, a vacation.msg filesuch as
Subject: I am on vacation
I am on vacation until July 22.
Your mail regarding "$SUBJECT" will be read when I return.
If you have something urgent, please contact
Joe Jones (jones@fB0).
Johnwill include the subject of the message in the reply
No message is sent if the To: or the Cc: line does not list the user to whom theoriginal message was sent or one of a number of aliases for them, if the initial Fromline includes the string−REQUEST@, or if a Precedence: bulk or Precedence:junkline is included in the header
vacationwill also not respond to mail from either postmaster or
Mailer-Daemon
vacation(1)
Files
Trang 3~/.vacation.msg
A list of senders is kept in the dbm format files vacation.pag and.vacation.dirin your home directory These files are dbm files and cannot beviewed directly with text editors
See attributes(5) for descriptions of the following attributes:
Trang 4vc – version control
vc [-a] [-t] [-c char] [-s] [keyword=value… keyword=value]
This command is obsolete and will be removed in the next release
The vc command copies lines from the standard input to the standard output undercontrol of its arguments and of ‘‘control statements’’ encountered in the standard
input In the process of performing the copy operation, user-declared keywords may be replaced by their string value when they appear in plain text and/or control
statements
The copying of lines from the standard input to the standard output is conditional,based on tests (in control statements) of keyword values specified in controlstatements or as vc command arguments
A control statement is a single line beginning with a control character, except asmodified by the -t keyletter (see below) The default control character is colon (:),except as modified by the -c keyletter (see below) Input lines beginning with abackslash (\) followed by a control character are not control lines and are copied to thestandard output with the backslash removed Lines beginning with a backslashfollowed by a non-control character are copied in their entirety
A keyword is composed of 9 or less alphanumerics; the first must be alphabetic Avalue is any ASCII string that can be created with ed; a numeric value is an unsignedstring of digits Keyword values may not contain blanks or tabs
Replacement of keywords by values is done whenever a keyword surrounded bycontrol characters is encountered on a version control statement The -a keyletter (seebelow) forces replacement of keywords in all lines of text An uninterpreted controlcharacter may be included in a value by preceding it with \ If a literal \ is desired,then it too must be preceded by \
The following options are supported:
-a Forces replacement of keywords surrounded by control characters with
their assigned value in all text lines and not just in vc statements
-t All characters from the beginning of a line up to and including the first tab
character are ignored for the purpose of detecting a control statement If acontrol statement is found, all characters up to and including the tab arediscarded
-cchar Specifies a control character to be used in place of the ‘‘:’’ default
-s Silences warning messages (not error) that are normally printed on the
diagnostic output
vcrecognizes the following version control statements:
:dcl keyword[, , keyword] Declare keywords All keywords must be
Trang 5:asg keyword=value Assign values to keywords An asg
statement overrides the assignment for thecorresponding keyword on the vc
command line and all previous asgstatements for that keyword Keywords thatare declared but are not assigned valueshave null values
:ifcondition
condition is true, all lines between the ifstatement and the matching end statementare copied to the standard output If thecondition is false, all intervening lines arediscarded, including control statements.Note: Intervening if statements andmatching end statements are recognizedsolely for the purpose of maintaining theproper if-end matching
The syntax of a condition is:
<cond> ::= [ ‘‘not’’ ] <or>
<or> ::= <and> | <and> ‘‘|’’
The available operators and their meaningsare:
1634 man pages section 1: User Commands • Last Revised 5 Jul 1990
Trang 6< less than() used for logical groupingsnot may only occur immediately
after the if, and when present,inverts the value of the entirecondition
The > and < operate only on unsignedinteger values (for example, : 012 > 12 isfalse) All other operators take strings asarguments (for example, : 012 != 12 istrue)
The precedence of the operators (fromhighest to lowest) is:
= != > < all of equal precedence
&
|Parentheses may be used to alter the order
of precedence
Values must be separated from operators orparentheses by at least one blank or tab
to the standard output The two leadingcontrol characters are removed, andkeywords surrounded by control characters
in text are replaced by their value before theline is copied to the output file This action
is independent of the -a keyletter
:on
lines
:msgmessage Print message on the diagnostic output.
ERROR: err statement on line (915)
vc(1)
Trang 7on the diagnostic output vc haltsexecution, and returns an exit code of 1.See attributes(5) for descriptions of the following attributes:
Trang 8vgrind – grind nice program listings
vgrind [-2fntwx] [-d defs-file] [-h header] [-l language] [-s n]
[-o pagelist] [-P printer] [-T output-device] filename…
The vgrind utility formats the program sources named by the filename arguments in a
nice style using troff(1) Comments are placed in italics, keywords in bold face, and
as each function is encountered its name is listed on the page margin
vgrindruns in two basic modes, filter mode or regular mode In filter mode, vgrindacts as a filter in a manner similar to tbl(1) The standard input is passed directly tothe standard output except for lines bracketed by the troff-like macros:
.vS starts processing.vE ends processingThese lines are formatted as described above The output from this filter can be passed
to troff for output There need be no particular ordering with eqn(1) or tbl(1)
In regular mode, vgrind accepts input filenames, processes them, and passes them to
trofffor output Use a hyphen (‘−’) to specify standard input; otherwise, vgrindwill exit without attempting to read from the standard input Filenames must bespecified after all other option arguments
In regular mode, if the -t or -P option is specified, the output is:
■ emitted (in troff format) to stdout if the -t option is specified
■ printed (as PostScript) to the named printer if the -P option is specified
Otherwise, the output is:
■ printed (as PostScript) on the system default printer, if one is defined, and thecommand’s stdout is a tty
■ emitted (as PostScript) to stdout if it is not a tty (that is, if stdout is a pipe or aredirect to a file)
In both modes, vgrind passes any lines beginning with a decimal point withoutconversion
The following options are supported:
-2 Produces two-column output Specifying this option changes the
default point size to 8 (as if the -s8 option were supplied) It alsoarranges for output to appear in landscape mode
-n Does not make keywords boldface
-w Considers TAB characters to be spaced four columns apart instead
of the usual eight
Trang 9-x Outputs the index file in a “pretty” format The index file itself is
produced whenever vgrind is run with a file called index that ispresent in the current directory The index of function definitionscan then be run off by giving vgrind the -x option and the fileindexas argument
-ddefs-file Specifies an alternate language definitions file (default is
/usr/lib/vgrindefs)
-hheader Specifies a header to appear in the center of every output page
Use quotes to specify headers with embedded spaces
-llanguage Specifies the language to use Among the languages currently
known are: Bourne shell (-lsh), C (-lc, the default), C++
(-lc++), C shell (-lcsh), emacs MLisp (-lml), FORTRAN (-lf),Icon (-lI), ISP (-i), LDL (-lLDL), Model (-lm), Pascal (-lp), andRATFOR (-lr)
-Pprinter Sends output to the named printer.
-sn Specifies a point size to use on output (exactly the same as the
argument of a troff ps point size request)
vgrindpasses the following options to the formatter specified by the TROFFenvironment variable See ENVIRONMENT VARIABLES
-t Similar to the same option in troff; that is, formatted text goes to
the standard output
-opagelist Prints only those pages whose page numbers appear in the
comma-separated pagelist of numbers and ranges A range N−M means pages N through M; an initial -N means from the beginning
to page N; and a final N− means from N to the end.
-Toutput-device Formats output for the specified output-device.
The following operand is supported:
filename Name of the program source to be processed by vgrind Use ‘−’ to
specify the standard input
In regular mode, vgrind feeds its intermediate output to the text formatter given bythe value of the TROFF environment variable, or to /usr/bin/troff if this variable
is not defined in the environment This mechanism allows for local variations introff’s name
indexfile where source for index is created/usr/lib/vgrindefs
Trang 10/usr/share/lib/tmac/tmac.vgrindmacro package
See attributes(5) for descriptions of the following attributes:
csh(1), ctags(1), eqn(1), tbl(1), troff(1), attributes(5), vgrindefs(5)vgrindassumes that a certain programming style is followed:
C Function names can be preceded on a line only by SPACE, TAB, or
an asterisk (*) The parenthesized arguments must also be on thesame line
FORTRAN Function names need to appear on the same line as the keywords
functionor procedure
If these conventions are not followed, the indexing and marginal function namecomment mechanisms will fail
More generally, arbitrary formatting styles for programs usually give unsightly results
To prepare a program for vgrind output, use TAB rather than SPACE characters toalign source code properly, since vgrind uses variable width fonts
The mechanism of ctags(1) in recognizing functions should be used here
The -w option is annoying, but there is no other way to achieve the desired effect.The macros defined in tmac.vgrind do not coexist gracefully with those of othermacro packages, making filter mode difficult to use effectively
vgrinddoes not process certain special characters in csh(1) scripts correctly
vgrind(1)
ATTRIBUTES
SEE ALSO
BUGS
Trang 11The tmac.vgrind formatting macros wire in the page height and width used intwo-column mode, effectively making two column output useless for paper sizes otherthan the standard American size of 8.5 inches by 11 inches For other paper sizes, it isnecessary to edit the size values given in tmac.vgrind A better solution would be tocreate a troff output device specification intended specifically for landscape outputand record size information there.
vgrind(1)
1640 man pages section 1: User Commands • Last Revised 3 Mar 2000
Trang 12vi, view, vedit – screen-oriented (visual) display editor based on ex
/usr/bin/vi [-| -s] [-l] [-L] [-R] [-r [filename]] [-S] [-t tag] [-v][-V] [-x] [-wn] [-C] [+command | -c command]filename…
/usr/bin/view [-| -s] [-l] [-L] [-R] [-r [filename]] [-S] [-t tag][-v] [-V] [-x] [-wn] [-C] [+command | -c command]filename…
/usr/bin/vedit [-| -s] [-l] [-L] [-R] [-r [filename]] [-S] [-t tag]
[-v] [-V] [-x] [-wn] [-C] [+command | -c command]filename…
/usr/xpg4/bin/vi [-| -s] [-l] [-L] [-R] [-r [filename]] [-S] [-t tag][-v] [-V] [-x] [-wn] [-C] [+command | -c command]filename…
/usr/xpg4/bin/view [-| -s] [-l] [-L] [-R] [-r [filename]] [-S] [-t tag] [-v] [-V] [-x] [-wn] [-C] [+command | -c command]filename…
/usr/xpg4/bin/vedit [-| -s] [-l] [-L] [-R] [-r [filename]] [-S] [-t
tag] [-v] [-V] [-x] [-wn] [-C] [+command | -c command]filename…
vi(visual) is a display-oriented text editor based on an underlying line editor ex It ispossible to use the command mode of ex from within vi and to use the commandmode of vi from within ex The visual commands are described on this manual page;how to set options (like automatically numbering lines and automatically starting anew output line when you type carriage return) and all ex line editor commands aredescribed on the ex(1) manual page
When using vi, changes you make to the file are reflected in what you see on yourterminal screen The position of the cursor on the screen indicates the position withinthe file
The view invocation is the same as vi except that the readonly flag is set
The vedit invocation is intended for beginners It is the same as vi except that thereportflag is set to 1, the showmode and novice flags are set, and magic is turnedoff These defaults make it easier to learn how to use vi
The following invocation options are interpreted by vi (previously documentedoptions are discussed in the NOTES section of this manual page):
is useful when processing editor scripts
except that vi simulates the C command of
ex The C command is like the X command
of ex, except that all text read in is assumed
to have been encrypted
Trang 13-rfilename Edit filename after an editor or system crash.
(Recovers the version of filename that was in
the buffer when the crash occurred.)
preventing accidental overwriting of thefile
-ttag option to tell vi that the tags file
may not be sorted and that, if the binarysearch (which relies on a sorted tags file) for
tag fails to find it, the much slower linear
search should also be done Since the linearsearch is slow, users of large tags filesshould ensure that the tags files are sortedrather than use this flag Creation of tagsfiles normally produces sorted tags files Seectags(1) for more information on tags files
position the editor at its definition
You can achieve the same effect by simplytyping the vi command itself
means of standard input, the input will beechoed to standard error This may beuseful when processing ex commandswithin shell scripts
useful when using the editor over a slowspeed line
the X command of ex and prompts the userfor a key This key is used to encrypt anddecrypt text using the algorithm of thecryptcommand The X command makes
an educated guess to determine whethertext read in is encrypted or not Thetemporary buffer file is encrypted also,using a transformed version of the keytyped in for the -x option If an emptyencryption key is entered (that is, if thereturn key is pressed right after theprompt), the file will not be encrypted Thisvi(1)
1642 man pages section 1: User Commands • Last Revised 18 Jun 1998
Trang 14is a good way to decrypt a file erroneouslyencrypted with a mistyped encryption key,such as a backspace or undo key.
+command | -c command Begin editing by executing the specified
editor command (usually a search or
positioning command)
If both the -t tag and the -c command options are given, the -t tag option will be processed first That is, the file containing tag is selected by -t and then the command
is executed
The following operands are supported:
filename A file to be edited
Command Normal and initial mode Other modes return to command mode
upon completion ESC (escape) is used to cancel a partialcommand
Input Entered by setting any of the following options:
a A i I o O c C s S RArbitrary text may then be entered.Input mode is normally terminated with the ESC character, or,abnormally, with an interrupt
Last line Reading input for : / ? or ! Terminate by typing a carriage
return An interrupt cancels termination
In the descriptions, CR stands for carriage return and ESC stands for the escape key
←
→down-arrowup-arrow arrow keys move the cursor
h j k l same as arrow keys
itextESC insert text cwnewESC change word to new easESC pluralize word (end of word; append s; escape from input state)
Trang 15ZZ exit vi, saving changes:q!CR quit, discarding changes
/textCR search for text
:cmdCR any ex or ed commandNumbers may be typed as a prefix to some commands They are interpreted in one ofthese ways:
line/column number z G |
repeat effect most of the restESC end insert or incomplete commandDEL (delete or rubout) interrupts
ZZ if file modified, write and exit; otherwise, exit
:w!CR forced write, if permission originally not valid
:q!CR quit, discard changes
:e nameCR edit file name
:e!CR reedit, discard changes
:e + nameCR edit, starting at end
:e +nCR edit, starting at line n
:e #CR edit alternate file:e! #CR edit alternate file, discard changes
:w nameCR write file name :w! nameCR overwrite file name
:shCR run shell, then return
:!cmdCR run cmd, then return
:nCR edit next file in arglist
:n argsCR specify new arglist
^G show current file and line
:ta tagCR position cursor to tag
Trang 16In general, any ex or ed command (such as substitute or global) may be typed,
preceded by a colon and followed by a carriage return
nG go to the beginning of the specified line (end default), where n is a
line number
/pat next line matching pat
?pat previous line matching pat
/pat/+n nth line after pat
?pat?−n nth line before pat
^R clear and redraw window if ^L is→ keyzCR redraw screen with current line at top of windowz−CR redraw screen with current line at bottom of windowz.CR redraw screen with current line at center of window
/pat/z−CR move pat line to bottom of window
`` move cursor to previous context
Trang 17mx mark current position with the ASCII lower-case letter x
´x move cursor to first non-white space in line marked by x
+ next line, at first non-white space character
− previous line, at first non-white space character
down-arrow
or j next line, same columnup-arrow
or k previous line, same column
^ first non-white space character
tx move to character following the next x
Tx move to character following the previous x
; repeat last f, F, t, or T, repeat inverse of last f, F, t, or T
Trang 18} to next paragraph
^H erase last character (backspace)
erase your erase character, same as ^H (backspace)kill your kill character, erase this line of input
\ quotes your erase and kill charactersESC ends insertion, back to command modeCTRL−C interrupt, suspends insert mode
^D backtab one character; reset left margin of autoindent
^^D caret (^) followed by control-d (^D); backtab to beginning of line;
do not reset left margin of autoindent
0^D backtab to beginning of line; reset left margin of autoindent
^V quote non-printable character
I insert before first non-blank
rx replace single character with x RtextESC replace characters
Operators are followed by a cursor motion and affect all text that would have beenmoved over For example, since w moves over a word, dw deletes the word that would
be moved over Double the operator, for example dd, to affect whole lines
Trang 19< left shift
D delete rest of line (d$)
s substitute characters (cl)
X delete characters before cursor dh)
Put inserts the text most recently deleted or yanked; however, if a buffer is named(using the ASCII lower-case letters a - z), the text in that buffer is put instead
p put back text after cursor
P put back text before cursor
"xp put from buffer x
“dp retrieve d’th last delete
See largefile(5) for the description of the behavior of vi and view whenencountering files greater than or equal to 2 Gbyte ( 231bytes)
See environ(5) for descriptions of the following environment variables that affect theexecution of vi: LC_CTYPE, LC_TIME, LC_MESSAGES, and NLSPATH
files are placed; it can be changed using thedirectoryoption (see the ex(1)
command)/usr/share/lib/terminfo/?/* compiled terminal description database
Trang 20/usr/lib/.COREterm/?/* subset of compiled terminal description
databaseSee attributes(5) for descriptions of the following attributes:
intro(1), ctags(1), ed(1), edit(1), ex(1), attributes(5), environ(5),largefile(5), standards(5)
Solaris Advanced User’s Guide
viand ex were developed by The University of California, Berkeley California,Computer Science Division, Department of Electrical Engineering and ComputerScience
Two options, although they continue to be supported, have been replaced in thedocumentation by options that follow the Command Syntax Standard (see intro(1))
An -r option that is not followed with an option-argument has been replaced by -Land +command has been replaced by -c command
The message file too large to recover with -r option, which is seen when
a file is loaded, indicates that the file can be edited and saved successfully, but if theediting session is lost, recovery of the file with the -r option will not be possible.The editing environment defaults to certain configuration options When an editingsession is initiated, vi attempts to read the EXINIT environment variable If it exists,the editor uses the values defined in EXINIT; otherwise the values set in
$HOME/.exrcare used If $HOME/.exrc does not exist, the default values are used
To use a copy of exrc located in the current directory other than $HOME, set the exrc
option in EXINIT or $HOME/.exrc Options set in EXINIT can be turned off in a
local exrc only if exrc is set in EXINIT or $HOME/.exrc.
Tampering with entries in /usr/share/lib/terminfo/?/* or/usr/share/lib/terminfo/?/*(for example, changing or removing an entry) canaffect programs such as vi that expect the entry to be present and correct In
particular, removing the "dumb" terminal may cause unexpected problems
Trang 21Software tabs using ^T work only immediately after the autoindent.
Left and right shifts on intelligent terminals do not make use of insert and deletecharacter operations in the terminal
The standard Solaris version of vi will be replaced by the POSIX.2-conformingversion (see standards(5)) in the future Scripts which use the ex family ofaddressing and features should use the /usr/xpg4/bin version of these utilities.vi(1)
1650 man pages section 1: User Commands • Last Revised 18 Jun 1998
Trang 22vipw – edit the password file
/usr/ucb/vipw
vipwedits the password file while setting the appropriate locks, and does anynecessary processing after the password file is unlocked If the password file is alreadybeing edited, then you will be told to try again later The vi(1) editor will be usedunless the environment variable VISUAL or EDITOR indicates an alternate editor.vipwperforms a number of consistency checks on the password entry for root, andwill not allow a password file with a “mangled” root entry to be installed It alsochecks the /etc/shells file to verify the login shell for root
/etc/ptmp/etc/shellsSee attributes(5) for descriptions of the following attributes:
Trang 23volcancel – cancel user’s request for removable media that is not currently in drive
/usr/lib/vold/volcancel [-n] [volume]
volcancelcancels a user’s request to access a particular floppy or CD-ROM filesystem This command is useful when the removable media containing the file system
is not currently in the drive
Use the path /vol/rdsk/name_of_volume to specify the volume If called without a
volume name to cancel, volcancel checks for Volume Management running.-n Display the nickname to the device name translation table
EXAMPLE 1A sample of the volcancel command
To cancel a request to access an unnamed CD-ROM, useexample% /usr/lib/vold/volcancel vol/rdsk/unnamed_cdrom
To check if volume management is running, use:
example% /usr/lib/vold/volcancel || echo volmgmt not runningSee attributes(5) for descriptions of the following attributes:
Trang 24volcheck – checks for media in a drive and by default checks all floppy media
volcheck [-v] [-i secs] [-t secs] pathname The volcheck utility tells Volume Management to look at each dev/pathname in
sequence and determine if new media has been inserted in the drive
The default action is to volcheck all checkable media managed by volumemanagement
The following options are supported:
-isecs Set the frequency of device checking to secs seconds The default is 2
seconds The minimum frequency is 1 second
-tsecs Check the named device(s) for the next secs seconds The maximum
number of seconds allowed is 28800, which is 8 hours The frequency ofchecking is specified by -i There is no default total time
The following operands are supported:
pathname The path name of a media device
EXAMPLE 1A sample of the volcheck command
The following example
example% volcheck −v /dev/diskette /dev/diskette has media
asks Volume Management to examine the floppy drive for new media
The following example
example% volcheck −i 2 −t 600 /dev/diskette1 &
asks Volume Management if there is a floppy in the floppy drive every 2 seconds for
Trang 25Due to a hardware limitation in many floppy drives, the act of checking for mediacauses mechanical action in the floppy drive Continuous polling of thefloppy drive will cause the drive to wear out It is recommended thatpolling the drive only be performed during periods of high use.
volcheck(1)
WARNINGS
1654 man pages section 1: User Commands • Last Revised 21 Feb 1997
Trang 26volmissing – notify user that volume requested is not in the CD-ROM or floppy drive
You can change the notification method for your system by editing the vold.confconfiguration file and providing a new option for volmissing in the notify entryunder the Events category
-c Send a message to the user’s console requesting the volume be
inserted To end the notification without inserting the requestedvolume, use volcancel(1)
-p All volmissing events will be handled through a GUI, provided
a window system is running on the console If this option isspecified, and no window system is running, all messages go tothe system console
-s Send one message to the syslogd(1M)
-malias Send a mail message to the specified mail alias about the missing
volume
/etc/vold.confVolume Management daemon configuration file Directs the Volume Managementdaemon to control certain devices, and causes action to be taken when specificcriteria is met
/usr/lib/vold/volmissing_popupPop-up used when the -p option is supplied and a window system is running.See attributes(5) for descriptions of the following attributes:
Trang 27volrmmount – call rmmount to mount or unmount media
volrmmount [-i | -e] [name | nickname]
volrmmount [-d]
The volrmmount utility calls rmmount(1M) to, in effect, simulate an insertion (-i) or
an ejection (-e) Simulating an insertion often means that rmmount will mount themedia Conversely, simulating an ejection often means that rmmount will unmountthe media However, these actions can vary depending on the rmmount configurationand media type (see rmmount.conf(4))
For example, if you use the default /etc/rmmount.conf and insert a music CD, itwill not be mounted However, you can configure rmmount so that it calls workmanwhenever a music CD is inserted
This command allows you to override Volume Management’s usual handling of media(see EXAMPLES below)
The following options are supported:
-i Simulates an insertion of the specified media by calling rmmount
-e Simulates an ejection of the specified media by calling rmmount
-d Displays the name of the default device for volrmmount to handle This
device is used if no name or nickname is supplied.
The following operands are supported:
name The name that Volume Management recognizes as the device’s
name See volfs(7FS)
nickname A shortened version of the device’s name Following is the list of
Trang 28example% volrmmount −e floppy0
After volrmmount unmounts the floppy, if you wish to re-mount it (rather thanejecting it and reinserting it) use:
example% volrmmount −i floppy0
Notice that if you are using a named floppy, you can use its name in place offloppy0
/dev/volctl Volume Management control portSee attributes(5) for descriptions of the following attributes:
Trang 29vsig – synchronize a co-process with the controlling FMLI application
vsig
The vsig executable sends a SIGUSR2 signal to the controlling FMLI process Thissignal/alarm causes FMLI to execute the FMLI built-in command checkworld whichcauses all posted objects with a reread descriptor evaluating to TRUE to be reread.vsigtakes no arguments
EXAMPLE 1A sample output of vsig command
The following is a segment of a shell program:
echo "Sending this string to an FMLI process"
vsig
The vsig executable will flush the output buffer before it sends the SIGUSR2 signal to
make sure the string is actually in the pipe created by the cocreate function
See attributes(5) for descriptions of the following attributes:
coproc(1F), kill(1), kill(2), signal(3C), attributes(5)Because vsig synchronize with FMLI, it should be used rather than kill to send aSIGUSR2 signal to FMLI
Trang 30w – display information about currently logged-in users
w [-hlsuw] [user]
The w command displays a summary of the current activity on the system, includingwhat each user is doing The heading line shows the current time, the length of timethe system has been up, the number of users logged into the system, and the averagenumber of jobs in the run queue over the last 1, 5 and 15 minutes
The fields displayed are: the user’s login name, the name of the tty the user is on, the
time of day the user logged on (in hours:minutes), the idle time—that is, the number of minutes since the user last typed anything (in hours:minutes), the CPU time used by all processes and their children on that terminal (in minutes:seconds), the CPU time used
by the currently active processes (in minutes:seconds), and the name and arguments of
the current process
The following options are supported:
-h Suppresses the heading
-l Produces a long form of output, which is the default
-s Produces a short form of output In the short form, the tty is abbreviated,
the login time and CPU times are left off, as are the arguments tocommands
-u Produces the heading line which shows the current time, the length of time
the system has been up, the number of users logged into the system, andthe average number of jobs in the run queue over the last 1, 5 and 15minutes
-w Produces a long form of output, which is also the same as the default
user Name of a particular user for whom login information is displayed If
specified, output is restricted to that user
EXAMPLE 1Sample Output From the w Command
example% w
10:54am up 27 day(s), 57 mins, 1 user, load average: 0.28, 0.26, 0.22
ralph console 7:10am 1 10:05 4:31 w
example% w
10:54am up 27 day(s), 57 mins, 1 user, load average: 0.28, 0.26, 0.22
ralph console 7:10am 1 10:05 4:31 w
See environ(5) for descriptions of the following environment variables that affect theexecution of w: LC_CTYPE, LC_MESSAGES, and LC_TIME
/var/adm/utmpx user and accounting information
Trang 31See attributes(5) for descriptions of the following attributes:
ps(1), who(1), whodo(1M), utmpx(4), attributes(5), environ(5)The notion of the ‘‘current process’’ is unclear The current algorithm is ‘the highestnumbered process on the terminal that is not ignoring interrupts, or, if there is none,the highest numbered process on the terminal’ This fails, for example, in criticalsections of programs like the shell and editor, or when faulty programs running in thebackground fork and fail to ignore interrupts In cases where no process can be found,
wprints−
The CPU time is only an estimate, in particular, if someone leaves a backgroundprocess running after logging out, the person currently on that terminal is ‘‘charged’’with the time
Background processes are not shown, even though they account for much of the load
on the system
Sometimes processes, typically those in the background, are printed with null orgarbaged arguments In these cases, the name of the command is printed inparentheses
wdoes not know about the conventions for detecting background jobs It willsometimes find a background job instead of the right one
Trang 32wait – await process completion
Not all the processes of a pipeline with three or more stages are children of the shell,and thus cannot be waited for
Wait for your background process whose process ID is pid and report its termination status If pid is omitted, all your shell’s currently active background processes are
waited for and the return code will be 0 The wait utility accepts a job identifier,
when Job Control is enabled (jsh), and the argument, jobid, is preceded by a percent
sign (%)
If pid is not an active process ID, the wait utility will return immediately and the
return code will be 0
Wait for your background processes
When an asynchronous list is started by the shell, the process ID of the last command
in each element of the asynchronous list becomes known in the current shell executionenvironment
If the wait utility is invoked with no operands, it will wait until all process IDsknown to the invoking shell have terminated and exit with an exit status of 0
If one or more pid or jobid operands are specified that represent known process IDs (or jobids), the wait utility will wait until all of them have terminated If one or more pid
or jobid operands are specified that represent unknown process IDs (or jobids), wait
will treat them as if they were known process IDs (or jobids) that exited with exitstatus 127 The exit status returned by the wait utility will be the exit status of the
process requested by the last pid or jobid operand.
The known process IDs are applicable only for invocations of wait in the current shellexecution environment
The following operands are supported:
One of the following:
Trang 33pid The unsigned decimal integer process ID of a command, for which the
utility is to wait for the termination
jobid A job control job ID that identifies a background process group to be
waited for The job control job ID notation is applicable only for invocations
of wait in the current shell execution environment, and only on systemssupporting the job control option
On most implementations, wait is a shell built-in If it is called in a subshell orseparate utility execution environment, such as one of the following,
(wait) nohup wait find -exec wait \;it will return immediately because there will be no knownprocess IDs to wait for in those environments
EXAMPLE 1Using A Script To Identify The Termination SignalFor Although the exact value used when a process is terminated by a signal isunspecified, if it is known that a signal terminated a process, a script can still reliablyfigure out which signal is using kill, as shown by the following (/bin/ksh and/usr/xpg4/bin/sh):
sleep 1000&
pid=$!
kill -kill $pid wait $pid echo $pid was terminated by a SIG$(kill -l $(($? −128))) signal.
EXAMPLE 2Returning The Exit Status Of A Process
If the following sequence of commands is run in less than 31 seconds (/bin/ksh and/usr/xpg4/bin/sh):
sleep 257 | sleep 31 &
Trang 34ATTRIBUTE TYPE ATTRIBUTE VALUE
csh(1), jobs(1), ksh(1), sh(1), attributes(5), environ(5)
wait(1)
SEE ALSO
Trang 35wc – display a count of lines, words and characters in a file
wc [-c | -m | -C] [-lw] [file…]
The wc utility reads one or more input files and, by default, writes the number ofnewline characters, words and bytes contained in each input file to the standardoutput
The utility also writes a total count for all named files, if more than one input file isspecified
wcconsiders a word to be a non-zero-length string of characters delimited by white
space (for example, SPACE, TAB ) See iswspace(3C) or isspace(3C)
The following options are supported:
-c Count bytes
-m Count characters
-l Count lines
-w Count words delimited by white space characters or new line characters
Delimiting characters are Extended Unix Code (EUC) characters from anycode set defined by iswspace()
If no option is specified the default is -lwc (count lines, words, and bytes.)The following operand is supported:
file A path name of an input file If no file operands are specified, the standard
input will be used
See largefile(5) for the description of the behavior of wc when encountering filesgreater than or equal to 2 Gbyte ( 231bytes)
See environ(5) for descriptions of the following environment variables that affect theexecution of wc: LC_CTYPE, LC_MESSAGES, and NLSPATH
The following exit values are returned:
0 Successful completion
>0 An error occurred
See attributes(5) for descriptions of the following attributes:
Trang 36ATTRIBUTE TYPE ATTRIBUTE VALUE
cksum(1), isspace(3C), iswalpha(3C), iswspace(3C), setlocale(3C),
attributes(5), environ(5), largefile(5)
wc(1)
SEE ALSO
Trang 37what – extract SCCS version information from a file
what [-s] filename…
whatsearches each filename for occurrences of the pattern @(#) that the SCCS get
command (see sccs-get(1)) substitutes for the @(#) ID keyword, and prints whatfollows up to a ", >, NEWLINE, \, or null character
The following option is supported:
-s Stop after the first occurrence of the pattern
EXAMPLE 1Extracting SCCS version information
If a C program in file program.c containschar sccsid[ ] = " @(#)identification information ";
and program.c is compiled to yield program.o and a.out, the command:
example% what program.c program.o a.outproduces:
program.c: identification informationprogram.o: identification informationa.out: identification information
See attributes(5) for descriptions of the following attributes:
sccs(1), sccs-admin(1), sccs-cdc(1), sccs-comb(1), sccs-delta(1),sccs-get(1), sccs-help(1), sccs-prs(1), sccs-prt(1), sccs-rmdel(1),sccs-sact(1), sccs-sccsdiff(1), sccs-unget(1), sccs-val(1), sccsfile(4),attributes(5)
Use the SCCS help command for explanations (see sccs-help(1))
There is a remote possibility that a spurious occurrence of the ‘@(#)’ pattern could befound by what
Trang 38whatis – display a one-line summary about a keyword
whatis command…
whatislooks up a given command and displays the header line from the manual
section You can then run the man(1) command to get more information If the line
starts ‘name(section) ’ you can do ‘man -s section name’ to get the
documentation for it Try ‘whatis ed’ and then you should do ‘man -s 1 ed’ to getthe manual page for ed(1)
whatisis actually just the -f option to the man(1) command
whatisuses the /usr/share/man/windex database This database is created bycatman(1M) If this database does not exist, whatis will fail
/usr/share/man/windex Table of contents and keyword databaseSee attributes(5) for descriptions of the following attributes:
Trang 39whereis – locate the binary, source, and manual page files for a command
/usr/ucb/whereis [-bmsu] [-BMS directory… -f] filename…
The whereis utility locates source/binary and manuals sections for specified files.The supplied names are first stripped of leading pathname components and any
(single) trailing extension of the form ext, for example, c Prefixes of s resulting
from use of source code control are also dealt with whereis then attempts to locatethe desired program in a list of standard places:
etc /sbin /usr/bin /usr/ccs/bin /usr/ccs/lib /usr/lang /usr/lbin /usr/lib /usr/sbin /usr/ucb /usr/ucblib /usr/ucbinclude /usr/games /usr/local /usr/local/bin /usr/new /usr/old /usr/hosts /usr/include /usr/etc
The following options are supported:
-b Searches only for binaries
-B Changes or otherwise limits the places where whereis searches for
binaries
-f Terminates the last directory list and signals the start of file names, and
must be used when any of the -B, -M, or -S options are used.
-m Searches only for manual sections
-M Changes or otherwise limits the places where whereis searches for
manual sections
-s Searches only for sources
-S Changes or otherwise limit the places where whereis searches for sources.-u Searches for unusual entries A file is said to be unusual if it does not have
one entry of each requested type Thus ‘whereis -m -u *’ asks forthose files in the current directory which have no documentation
Trang 40EXAMPLE 1Finding filesFind all files in /usr/bin which are not documented in /usr/share/man/man1with source in /usr/src/cmd:
example% cd /usr/ucb example% whereis -u -M /usr/share/man/man1 -S /usr/src/cmd -f *
/usr/src/*
/usr/{doc,man}/*
/etc, /usr/{lib,bin,ucb,old,new,local}
See attributes(5) for descriptions of the following attributes:
chdir(2), attributes(5)Since whereis uses chdir(2) to run faster, pathnames given with the -M, -S, or -Bmust be full; that is, they must begin with a ‘/’