Manual pages › General commands (1)
setnewsho(1)
generate a string for the NEWSSERVER environment variable
From the original Amiga UNIX 2.1 manual. Some things it mentions may not be in this release.
NAME
newsserverstr - generate a string for the NEWSSERVER environment variable
SYNOPSIS
newsserverstr hostname
DESCRIPTION
newsserverstr generates and prints the proper value of the NEWSSERVER environment variable for the given hostname. If NEWSSERVER is set then NeWS clients will attempt to connect to the server it points to rather than the local host.
The format of the NEWSSERVER environment variable is as follows:
decimal-address . port# ; hostname
For example, if the host called ``paper'' has address 192.98.34.118, the NEWSSERVER variable should be set to ``3227656822.2000;paper'' so that NeWS clients will connect to the NeWS server on ``paper''. newsserverstr simply calculates this string and sends it to standard output. This is not its most convenient form, however. C-shell users can define the following alias:
alias snh 'setenv NEWSSERVER `newsserverstr \!*`'
and System V Bourne Shell users can define the following function:
snh () {
NEWSSERVER=`newsserverstr $*`
export NEWSSERVER
}
Both forms let you simply type `snh hostname' to set the NEWSSERVER environment variable automatically.
SEE ALSO
psh(1) NeWS Programmer's Guide
BUGS
The host table entry must have exactly the following format: a.b.c.d<tab>hostname.
If you use the snh alias or shell function, and the hostname you give is unknown, or you give too many or too few arguments, the NEWSSERVER variable will be trashed.