sourCEntral - mobile manpages

pdf

FLON

NAME

flon − show which of your friends are logged on

SYNOPSIS

flon [−a] [−A] [−b] [−B] [−d] [−D] [−e] [−E] [−h] [−H] [−i] [−I] [−p max_idle] [−P min_idle] [−t] [−T] [−f file] [−o format] [−O] [−y mesgy] [−Y] [−n mesgn] [−N] [−U file] [−v] [−V] [−w]

DESCRIPTION

flon shows which of your friends are currently logged on by matching entries in /etc/utmp with entries in $HOME/.friends, and displaying the matches.

The output that can displayed by flon is extremely configurable, and a variety of information about your friends can be discovered. Even the output of who can be emulated, (but flon is often much faster.)

The actual friends file that flon uses is user definable.

The friends file has the following format:

img

Any number of blank lines can occur between userid and pseudonym pairs, and field separators are any white space, except for one case: A pseudonym is only terminated by an end of line or EOF, because tabs and spaces can exist in pseudonyms.

Information such as user name, pseudonym, real name, login time, idle time, tty, remote host (if supported on your system), and mesg status can all be displayed by flon.

The pseudonym refers to the entry in the friends file corresponding to a particular user name.

If who is linked to flon, then flon will act much the same as the BSD version of who.

OPTIONS

flon accepts the following options:

−a

Show all entries, irrespective of whether or not they appear in the current friends file. If %p is present in the format string, and the current entry is in the friends file, the appropriate pseudonym is listed, otherwise a blank entry is displayed.

−A

The opposite of −a, this only lists users in the friends file.

−b

When used in conjunction with the format string specifier %p, then whenever a pseudonym cannot be found for the current entry, the appropriate real name for that user (obtained from the GCOS field of the /etc/passwd file) will be used (if there is one.) This option is only useful if −a is used.

−B

The opposite of −b, which only prints pseudonyms with the %p format specifier.

−d

Don’t print duplicates (where the user name is the same.) For the %l, %i, %m, and %t options, flon prints the information of the session with the least idle time.

−D

Do print duplicates. (Opposite of −d.)

−e

Exclude the listing of your friends. This option implies −a.

−E

Include the listing of your friends. (Opposite of −e.)

−h

Don´t display the header at the top of the output of flon.

−H

Display the header at the top of the output.

−i

Don’t display people that have been idle for longer than five minutes (This cutout time can be changed with −p.)

−I

Display people that have been idle for longer than five minutes. (Opposite of −i.)

−p limit

Sets the idle cutout limit for −i and −I to limit. The default unit for this limit is minutes, but a suffix of s or S indicates that the figure is in seconds. (A suffix of m or M explicitly specificies that the units are minutes.)

−P limit

Set the minimum period at which the idle message switches from `...´ to the actual value. Refer to −p for information on valid suffixes to this figure.

−t

Don’t display the trailer — the count of how many times you are logged on, and the total of how many people are logged on.

−T

Display the trailer.

−f file

Use file as the friends file (instead of $HOME/.friends .)

−o format

Use format as the template for flon’s output. (See below for the specification of format.)

−O

Use the default compiled-in format, which is usually:

%-u | %p | %12l | %i | %t | %2mTalk

−y string

Use string as the string to print in %p when messages are on.

−Y

Use the compiled in default for ontalk, usually `On´.

−n string

Use string as the string to print in %p when messages are off.

−N

Use the compiled in default for notalk, usually `No´.

−U file

Use file as the utmp file (instead of /etc/utmp.)

−v, −V

Display the version, usage and copyright information.

−w

Invoke flon as if it was invoked as who. (I.e., simulate that it’s name is who, to the point where `flon -w am I´ acts as `who am I´, etc.)

FORMAT SPECIFIERS

flon has a highly configurable output, which consists of a format string with static and variable fields. Much like printf(3), the format string of flon uses the % character as a specifier for the variable fields. This is the format of the specifier: %[flags][width]command.

flags are optional. There are two flags currently available:

use right justification for formatting that field.

.

use a variant width record (i.e, extra space won’t be added as padding to fill out the field to the required width.)

width can be anything from 0 to 255. If a width of 0, or no width at all is specified, the default width for that field is assumed.

specifiers can be any of:

%

A single % sign.

u

User name of the current entry.

r

Real name of the current entry. (From the /etc/passwd file.)

p

Pseudonym of this person. When flon is started with −a, a pseudonym will be shown only for those people who have one in your friends file. The only exception is when −b is used - then the real name will be printed instead ( %p acts the same as the %r in this case)

l

Login time on that particular session.

i

Idle time of that session. The value is in minutes : seconds. If the string `>>>´ is displayed, the session has been idle longer than 99 minutes, 59 seconds. If `...´ is displayed, the terminal has not been idle for at least 5 minutes. (The latter time is changable with −P.)

t

The tty of that particular session.

m

mesg status of that session. If y, `On´ is displayed (unless −y mesgy is defined, then mesgy will be displayed.) If it is n, `No´ is displayed (or mesgn if −n mesgn is used.)

c

Number of times that person is logged on.

x

Prints an `x´ if the number of times logged on is greater than 1.

a

Prints the mesgy string if any of the sessions for that person have messages on. (The ‘availability’ field.) If all sessions have messages off, the mesgn string is printed.

h

Print the host that the user logged in from, but only if your system supports it (via the existance of the ut_host field in the /etc/utmp.) Otherwise, an empty string will be printed.

b

Print the host (see %h) in parenthesis if the field is non-empty.

ENVIRONMENT

FLON

Contains default arguments that the user wants flon to use. Command line options override any settings in FLON.

The FLON variable can contain any of the command line arguments. If a string is to have a space in it, it should be quoted with single quotes, as: ´word1...wordn´ Note that some options (like −V) wont make sense in the environment variable.

For example (in csh(1))

setenv FLON "-ip30 -o’%-u %32p’"

will mean that by default, flon won’t print sessions idle longer than 30 minutes, and for each friend, only the username (right justified), and the pseudonym (field width of 32 characters) will be printed.

FILES

$ HOME /.friends

/etc/utmp

/etc/passwd

EXAMPLE FRIENDS FILE

img

SEE ALSO

who(1), utmp(5).

LIMITATIONS

The maximum width of any specified field is 255 characters.

WARNINGS

If a tty in /dev cannot be statted, flon will print an entry for that user, but without the mesg or idle status.

If the friends file is unavailable (due to permissions or non-existance), then flon will operate as if run with the −a (list all) option, with no pseudonyms.

HISTORY

flon has a long line of ancestors. Many years ago at RMIT, on the Cyber 760 running NOS, Marc Boschma [Tau] wrote lon. Primitive as it was, it did the job, looking up your friends logged on. When UNIX arrived at RMIT, it was soon ported, with a version by Simon Burge [Snark] also appearing. Other versions were written, including a derivative bcoh. The problem was that lon, bcoh, and all the derivatives were slow, and lacked rampant featuritus (although some may consider this lack a good thing.) These factors prompted me to write flon.

For their suggestions, bug fixes, and hints, thanks go to:

img

AUTHOR

Luke Mewburn, <lm AT rmit DOT edu DOT au>.

Portions of the environment variable code are derived from code from gzip, by Jean-loup Gailey, which in turn was derived from code I donated to that package.

VERSION

This manual documents flon version 3.3.3, 940421.

pdf