PEG

Section: User Commands (1)
Updated: mplex
Index Return to Main Contents
 

NAME

peg - pegboard system  

SYNTAX

peg [-u|i user ] [-c text ] [-lnqtvx] [+N[m|h|d|w] [H[:[M]][p]] [[[Y]/M]/D] [day] [month mday]  

OPTIONS

-q
suppress heading when reporting, suppress printing of date when updating
-uuser
print specific user's pegboard entry
-iuser
(interrogate) returns a value of 0 if the user is on the pegboard, 1 if not
-ctext
may be used to add a comment that is printed with the pegboard
-t
Log off until tomorrow. The file ".pegrc" in the invoking users home directory is consulted to get the time of day the user starts work.
-v
Verify only, with this option the time and date arguments are parsed and the target time is printed. The pegboard is not updated nor is the invoker logged off.
-x
Remove the invoking users peg. It is not desirable for this option to work when peg is invoked from certain ttys, specifically modems and some network ports. This situation occurs when "peg -x" is put in the system .profile, (or equivalent) and a user dials in on a modem port. A facility is provided to avoid this in the file /etc/default/peg ( see FILES heading below).
-n
don't log off after updating pegboard
-l
Prints long format
 

DESCRIPTION

peg maintains a list of users who have logged off the system (a pegboard ), and dates and times of when they intend return to the site. The default action when no arguments are given is to print the pegboard contents on standard output. The -u option may be used to print the pegboard entry for a specific user. Context of arguments is dependent on their format. Arguments that contain a "/" character are taken to be a date, and one or two "/"'s may be present. In the case of one, "MM/DD" is taken as a month and a day. "YY/MM/DD" is taken as year month and day. Arguments that contain a ":" are taken as a time, and only one ":" may be present. "HH:MM" is taken as hour and minute. A single argument is taken to be an hour in the current day. Hours are in 24 hour format, unless the argument is suffixed with the letter "p", in which case the time is assumed to be after 12 noon. Finally, a full date and time specification may be given by providing both arguments, in either order. Numeric arguments may be preceded by a "+", in this case the argument is taken as a "relative" quantity of time. There may be an optional modifier after relative arguments, legal modifiers are "m", "h", "d" and "w".
m
the offset is taken as a number of minutes from the current time
h
the offset is taken as a number of hours from the current time (default)
d
the offset is taken as a number of days from the current date
w
the offset is taken as a number of weeks from the current date If a modifier is not given and the argument is in "+n" format, "n" is assumed to be a number of hours from the current time (the h modifier is redundant). Peg recognizes names of days and months as well. Month names must be followed by a day, ie. Sept 12. The next occurrence of a day or month/day combination specified is assumed. So specifying Tue on a Wednesday results in Tuesday of next week being the specified day. Similarly, giving a month/day that has already gone by results in that day in the next year being the specified date. Any (reasonable) number of arguments may be given. The effect of multiple arguments is additive, so specifying more than one absolute date or time will not likely yield expected results. Mixing one absolute date with some number of relative type arguments has the effect of adding the relative arguments to the absolute. After the pegboard is updated (and the -n, -x, -i or -v options were not given), all processes in the process group are sent the signal SIGKILL. peg should be run with the "-x" option in the system .profile so that each time the a user logs onto the system their pegboard entry is expunged.
 

EXAMPLES

peg 99/1/12 14:00
Log off and peg invoking user to be back January 12, 1999, at 2:00 pm
peg 2:00p 99/1/12
Same as above
peg 3/10
Log off and peg invoking user to be back March 10 at the current time. If March 10th has passed then March 10th next year is assumed.
peg +2
Log off and peg invoking user to be back 2 hours from current time
peg 2:00p
Log off and peg invoking user to be back at 2pm today
peg +45m
Log off and peg invoking user to be back 45 minutes from the current time
peg -t +3d
Log off and peg invoking user to be back 3 days from current date at the time found in the ".pegrc" file in their home directory
peg -t
Log off and and peg invoking user to be back on the next day and time that has an entry in the ".pegrc" file. Days that have no entry will be skipped over.
peg -t 14
Log off and peg invoking user to be back 2:00 pm on the next day specified in their .pegrc file.
peg -v +1 +1 +1
print what time it will be in three hours
 

FILES

/etc/default/peg
/$HOME/.pegrc
These files may have default start times for users in the format:
MON 8:00

TUE 8:00

   .

   .

   .

FRI 8:00
SAT -

SUN -
In addition, /etc/default/peg should contain entries of these formats:
PEGDIR /usr/spool
This variable specifies the directory that peg uses for the pegboard. Each machine associated with a common pegboard should have an "/etc/default/peg" file, specifying a common directory in the PEGDIR variable. The pegbord file in the common directory must be readable and writable by all users.
NOUNPEG /dev/ttyxx
Used to specify tty's that override the action of the -x option. If peg is invoked from a tty that is listed thusly in /etc/default/peg then the program exits without updating the pegboard. Ports that are connected to modems should be listed in this manner.
PEGDIR/pegboard.a*
holds a copy of the pegboard when update is in progress
$HOME/.pegrc
default start time of day and days of week
/etc/passwd
Usernames etc. are extracted from this file. The users name is assumed to be in the "gecos" field of the passwd entry
 

NOTES

The pegboard is maintained using user id numbers. Only the first 3 letters of day and month names are significant. If the real user id of the invoking user is 0 and the -u command line option is given then the specified users pegboard entry is updated to the date given. If the invoking user id is 0 and both the -u and -x options are given then the user name specified as the -u argument is removed from the pegboard. Week and month names etc. in the command line and tokens and variable names in the .pegrc and /etc/default/peg files are not case sensitive. Arguments in the /etc/default/peg and .pegrc files are case sensitive. Comments are restricted to 64 characters, and must be whitespace or printable. They are truncated to 32 characters in the short form to avoid messing up screens (assuming 80 column ttys). The complete comment may be read by invoking with the "-l" option. If no PEGDIR variable is found in the /etc/default/peg file then the default directory used is /usr/spool.


 

Index

NAME
SYNTAX
OPTIONS
DESCRIPTION
EXAMPLES
FILES
NOTES

This document was created by man2html, using the manual pages.
Time: 06:16:07 GMT, December 12, 2024