.\" @(#)setnewshost.1 9.2 88/01/19 Copyright 1987 Sun Micro .TH SETNEWSHOST 1 "11 March 1987" .SH NAME setnewshost \- generate a string for the NEWSSERVER environment variable .SH SYNOPSIS \fBsetnewshost\fP \fIhostname\fP .IX setnewshost#(1) "" "\fLsetnewshost\fP(1) \(em set NEWSSERVER environment" .IX "contacting the server" setnewshost#(1) "" "\fLsetnewshost\fP(1) \(em set NEWSSERVER environment" .SH DESCRIPTION .I setnewshost generates and prints the proper value of the NEWSSERVER .IX "contacting the server" NEWSSERVER&# "" \fLNEWSSERVER\fP environment variable for the given \fIhostname\fP. If NEWSSERVER is set then NeWS clients will attempt to connect to the server it points to rather than the local host. .LP The format of the NEWSSERVER environment variable is as follows: .sp \fIdecimal-address\fP\fB . \fP\fIport#\fP\fB ; \fP\fIhostname\fP .sp 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''. \%\fIsetnewshost\fP 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: .RS .5i alias snh 'setenv NEWSSERVER `setnewshost \\!*`' .RE and System V Bourne Shell users can define the following function: .RS .5i snh () { NEWSSERVER=`setnewshost $*` export NEWSSERVER .br } .RE Both forms let you simply type `\fBsnh\fP \fIhostname\fP' to set the NEWSSERVER environment variable automatically. .SH "SEE ALSO" psh(1) .LP .I "NeWS Manual" .SH BUGS The host table entry must have exactly the following format: \fBa.b.c.d\fP\fI<tab>\fP\fBhostname\fP. If you use the \fBsnh\fP 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.