HDTenEightyP/NetNews huggingface dataset:
From: kherron@ms.uky.edu (Kenneth Herron)
Subject: Re: forking and forking and forking...
Distribution: na
Date: Tue, 15 Sep 1992 12:38:13 GMT
Organization: University Of Kentucky, Dept. of Math Sciences

rdorich@jade.tufts.edu (Rob) writes:

>	for(;;) fork();

>After a few processes have been started, the user blows his processes
>quota, and nothing else can be done.  Actually, kill works, but a new
>process is immediately put up.  Is there any other solution other than
>shutting the whole system down?

Send them all STOP signals, then once they're all stopped send them
KILL signals.
-- 
Kenneth Herron                                           kherron@ms.uky.edu
University of Kentucky                                      +1 606 257 2975
Department of Mathematics           "Thanks to the magic of the slow-motion 
camera, we can now show you how ugly the inside of someone's mouth can be."
Newsgroups: comp.unix.questions
From: rot@multisys.com (Republic of Taiwan)
Subject: Re: need script to rename uppercase filenames
Keywords: script,tar,msdos
Organization: Multimedia Information Systems Corporation, San Jose, CA                        TEL: (408) 436-8929            E-mail: info@multisys.com
Date: Mon, 7 Sep 1992 07:00:22 GMT

In article <699@svcs1.UUCP> slix@svcs1.UUCP (Bill Miller) writes:
=Hi, everyone.
=
=I'm fairly new to unix, and I need a script or procedure to do the following:
= 
=I have some source code in DOS (many separate files) that I tarred under
=DOS and untarred under 386BSD.  The big problem is that all the files
=came through in UPPERCASE and I need a script to mv (rename) them all
=to lowercase quickly.
= 
=Since they're in DOS text format, I realize I also need to strip the 
=extra carriage returns on each line.  I've been successful in doing this
=with:
= 
=  cat (file) | tr -d '\015' > (newfile)
= 
=It would be nice to combine both of these so that I could rename the
=files to uppercase and strip the extra newlines all in one fell swoop
=instead of doing it one file at a time.
=

#!/bin/csh -f
# ^M is contrl M, ^Z is control Z
#
foreach i ($*)
sed -e 's/^M//g' -e 's/^Z//g' $i  > `echo $i | tr A-Z a-z`;
rm $i;
end
From: aar50482@uxa.cso.uiuc.edu (amy)
Newsgroups: comp.unix.questions
Subject: Ytalk source code...
Keywords: ytalk
Date: 6 Sep 92 21:13:50 GMT
Organization: University of Illinois at Urbana

I'm looking for the source code for the most recent version of
ytalk. if anyone knows where i can get it, let me know.

				thanks in advance
					--amy
From: jallen@litani.nersc.gov (John Allen)
Newsgroups: comp.unix.questions
Subject: UDP checksum OFF in SunOS 4.1.2
Keywords: UDP CHECKSUM OFF SUNOS 4.1
Date: 15 Sep 92 17:38:59 GMT
Organization: National Energy Research Supercomputer Center

I know how to turn off udp checksum under ultrix:

$ dbx -k vmunix 
print udpcksum    (shows current state)
assign udpcksum=0 (to turn off)
assign udpcksum=1 (to turn on)
 

How can I do it under SunOS 4.1.2?

				John Allen

jallen@nersc.gov
jallen@es.net

Newsgroups: comp.unix.questions,comp.sys.sgi,comp.unix.misc
From: guy@Auspex.COM (Guy Harris)
Newsgroups: comp.unix.questions
Subject: Re: Nothing is a directory?
Date: 5 Sep 92 19:03:13 GMT
Organization: Auspex Systems, Santa Clara

>So, who is right?  Is nothing a directory?

It depends on the flavor of UNIX you're running.

In the original Research versions, such as V7, a null string referred to
the *current* directory - i.e., "", as a pathname, was equivalent to "."
- so yes, in that sense, in systems that work the way those versions of
UNIX do, nothing *is* a directory.

The groups doing systems such as SV preferred to make the null string,
as a pathname, not refer to any file.  In systems that work the way
those versions of UNIX do, nothing *isn't* a directory.

POSIX 1003.1 seems to specify the SV behavior.  As such, more and more
systems will, at least in their POSIX-compliant environments, behave the
way your SGI system behaves (IRIX is more SVish than V7ish).

SunOS releases prior to 5.0 have, as their "native" environment, an
environment that generally chooses to follow BSD rather than SV; BSD
chose to follow V7 rather than SV, so a null string was equivalent to
".".  In later pre-5.0 releases, the System V environment versions of
routines that take pathnames as arguments check for null strings and
behave in an SV-style fashion (or they rely on one of the routines they
call to do so).

In SunOS 5.0, the "native" environment is SVish, and behaves in an
SV-style fashion; the BSD environment appears to still handle null
strings in the fashion that V7 and older BSD systems do.

Presumably, 4.4BSD will behave in an SV-style fashion, rather than a
V7/BSD-style fashion, as it's intended to be POSIX-compliant, and POSIX
specifies the SV-style behavior.

However, even if you're running in the SV environment, the pre-5.0
"test" command behaves in a V7/BSD-ish fashion in that regard; the shell
was built in the BSD environment.  The 5.0 version vehaves in an SV-ish
fashion, even if you're running in the BSD environment; the shell was
built in the SV environment.

The bottom line:

	until everybody's POSIX 1003.1-compliant, be prepared for a null
	string to refer to the current directory; if need be, check for
	a null string before using it.

Newsgroups: comp.unix.questions
From: sfs@cbnewsm.cb.att.com (salvatore.savastano)
Subject: at(1) command fails
Organization: AT&T
Distribution: usa
Date: Thu, 10 Sep 1992 16:12:50 GMT


I have had the following problem for a long time and I can't
get/find an explanation on how to solve and avoid it.
I use the at(1) command to schedule up to about 1000 jobs at 1 minute intervals
(sometimes a few hundred less )

occasionally at(1) starts spitting out an extra message 
with each job scheduled and continues to do so until the end.  
Usually the messages begin half way through (that is early enough 
that they can't be accounted by running more or fewer jobs)
the messages look like this:
	...
	at: error in message send
	job 716077800.a at Wed Sep  9 16:30:00 1992
	at: error in message send
	job 716077860.a at Wed Sep  9 16:31:00 1992
	at: error in message send
	job 716077920.a at Wed Sep  9 16:32:00 1992
	at: error in message send
	job 716077980.a at Wed Sep  9 16:33:00 1992
	at: error in message send
	job 716078040.a at Wed Sep  9 16:34:00 1992
	at: error in message send
	job 716078100.a at Wed Sep  9 16:35:00 1992
	
	...
	at: error in message send
	job 716104560.a at Wed Sep  9 23:56:00 1992
	at: error in message send
	job 716104620.a at Wed Sep  9 23:57:00 1992
	at: error in message send
	job 716104680.a at Wed Sep  9 23:58:00 1992
	at: error in message send
	job 716104740.a at Wed Sep  9 23:59:00 1992
	at: error in message send
	job 716104800.a at Thu Sep 10 00:00:00 1992
	
	
	
	

also it seem that some of the at jobs with the error message actually run
and some don't

I would appreciate any suggestions that would help me avoid this
the machine is a :
	uname -a
	smst1n smst1n 3.2.2 3 3B2

and there seems to be plenty of space:
	df
	/         (/dev/dsk/c1t1d0s0):    29116 blocks     2166 i-nodes
	/tmp      (/dev/dsk/c1t3d0s9):    24788 blocks     1529 i-nodes
	/person   (/dev/dsk/c1t1d0s8):   144748 blocks    23316 i-nodes
	/tiw      (/dev/dsk/c1t1d0s9):    98622 blocks    12514 i-nodes
	/pub1n    (/dev/dsk/c1t1d0sa):    24756 blocks     3047 i-nodes
	/vui      (/dev/dsk/c1t1d0sb):   137242 blocks    17552 i-nodes
	/usr      (/dev/dsk/c1t3d0s2):    55636 blocks     5583 i-nodes
	/tiwlog   (/dev/dsk/c1t3d0s8):    22652 blocks     2927 i-nodes
	/usr/loc  (/dev/dsk/c1t3d0sa):    33706 blocks     9349 i-nodes
	/fda      (/dev/dsk/c1t3d0sb):   103910 blocks    15616 i-nodes
	
	
	
	
sal savastano
att!somerset!smst71!sfs
Newsgroups: comp.unix.questions
From: dcs@neutron (Dave Schweisguth)
Subject: Mysterious behavior of 'tin'
Organization: Yale University
X-Newsreader: Tin 1.1 PL5
Date: Fri, 11 Sep 1992 13:23:38 GMT

Hi all,

I sent this to Iain Lea (author of the 'tin' newsreader) and posted it to
comp.sys.sgi without results a few days ago. I'm reposting here, because it
looks to my untrained eye like it might be solvable by a more experienced
Unixite than I. (It appears there is no group relevant to 'tin' per se.)

==============================================================================

To: iain%anl433.uucp@Germany.EU.net
Subject: BUG REPORT tin 1.1 PL5 (NNTP)

BOX1: IRIX neutron 4.0.4 03241739 IP6

CFG1: active=1800  arts=1200  reread=0  longfilenames=0  setuid=0
CFG2: nntp=1  nntp_only=1  nntp_xuser=0  nntp_xindex=0  nntp_xspooldir=0

Please enter bug report/gripe/comment:

Hi again,

I am resubmitting this bug report, as it is still present in PL5.

I normally run tin as 'xwsh -e tin', which runs tin in its own window. ('xwsh'
is SGI's 'xterm'.) Sometimes, usually after I first log on, tin dies with the
message (which appears in the window):

tin: signal handler caught signal SIGSEGV (11).
tin: send a bug report to iain%anl433.uucp@Germany.EU.net

It appears that the system is in a state in which 'xwsh -e tin' does not work.
No number of attempts of 'xwsh -e tin' reverse this state. 'xwsh' (which,
without arguments, runs tcsh, my login shell), 'xterm' (which runs tcsh as a
non-login shell), or 'xterm -e tin' all reverse this state. 'tin',
'xwsh -e true', 'xwsh -e sh', 'xwsh -e csh', 'xwsh -e tcsh',
'xwsh -e tcsh -l', and logging in from an ASCII terminal (and running 'tin',
or not) do NOT reverse this state. Note that 'tin' without any windowing
foofaraw always works.

This may be tin's fault, as it does not occur with any other programs which I
run in their own windows in the same fashion (e.g. elm, emacs), but it may be
xwsh's fault, as it occurs with xwsh and not xterm, so it may be xwsh's fault.

==============================================================================

Thanks in advance to anyone with good ideas. I'll summarize mail.

Cheers,

--
| Dave Schweisguth   Yale MB&B & Chemistry   Email: dcs@neutron.chem.yale.edu |
| Lab phone: 203-432-5208      Fax: 203-432-6144     Home phone: 203-624-3866 |
From: ywhui@ieug0.ie.cuhk.hk
Newsgroups: comp.unix.questions
Subject: XIE
Date: 10 Sep 92 10:30:17 GMT

I would appreciate very much if anyone tell me where I can get the X
Image Extension source.

+----------------------------------------+
| Y. W. Hui (Miss)                       |
| Department of Information Engineering  |
| The Chinese University of Hong Kong    |
| Shatin, N.T.	+--------------------------------------------+
| HONG KONG     | Fax   : (852) 603-5032                     |
+---------------| Tel   : (852) 609-7975                     |
                | Email : (Internet) ywhui@eng.ie.cuhk.hk    |
                |         (Internet) ywhui@ieug0.ie.cuhk.hk  |
                |         (BITNET)   B091711@CUCSC.BITNET    |
                +--------------------------------------------+
Newsgroups: comp.unix.questions
From: usenet@inesc.pt (USENET News System)
Subject: Problem with uudecode
Organization: INESC - Inst. Eng. Sistemas e Computadores, LISBOA, PORTUGAL
Date: Tue, 8 Sep 1992 14:57:19 GMT

	I've saved several uuencoded files, that i got from some newsgroups,
	but everytime i try to uudecode them, i get the message 'Short file'.
	
	The files are almost always single, i mean, are not divided in
	file1, file2, etc, but i *always* get the same message.

	I'm working with Unix Sun Release 4.1.

	Can someone help me ?

----
 joao Pedro Martins, Lisboa, Portugal - jota@tutor.UUCP
 
 "Carpe Diem, she muttered, and laughed. We seize the day.	
  Well, sometimes, the day seizes back !" (Psychodrome) 
Newsgroups: comp.unix.questions
From: dattier@ddsw1.mcs.com (David W. Tamkin)
Subject: Re: Problem with uudecode
Organization: Contributor Account at ddsw1, Chicago, Illinois  60657
Date: Sat, 12 Sep 1992 18:45:45 GMT

eluyten@rc1.vub.ac.be (Eric Luyten) wrote in <732@rc1.vub.ac.be>:

| 1) There must be a line containing the word 'end' (and nothing else !)
|    at the end of the uuencoded file.

Indeed there must.  I wish that the uuencode standard had some provision for
"next" or "more" or "continue" as well as "end" so that a file or stdin could
contain the uuencodes of several binaries, all of which would be decoded and
written out by one call to uudecode without being split into separate files
first.

As it stands now, uudecode sees the "end" signal at the foot of the first
encoded file's data and stops.

David W. Tamkin   Box 59297   Northtown Station, Illinois  60659-0297
dattier@ddsw1.mcs.com    CompuServe: 73720,1570    MCI Mail: 426-1818
Newsgroups: comp.unix.questions,comp.sources.wanted
From: gregor@kafka.saic.com (gregg hanna)
Subject: Re: Playing CD in workstation A, hearing it in B, Can I?
Reply-To: gregor@kafka.saic.com
Organization: Science Applications International Corporation
Date: Mon, 7 Sep 1992 21:00:30 GMT

In article <1992Sep07.133745.14531@dcc.uchile.cl>, erodrigu@dcc.uchile.cl (Eduardo Rodriguez) writes:
|> 
|> I want to play a CD in a device connected to some workstation A,
|> but i want to hear it in other workstation B.
|>   Is there an utility that do that?. Both workstation are Sun Sparc
|> connected via Ethernet.
|> 

Try 'radio', it will allow you to broadcast audio over the ethernet,
and workstations can "tune" in to a "channel".  On wuarchive.wustl.edu
it's at /usenet/comp.sources.misc/volume30/radio2.0


                                         gregg hanna
                                         gregor@kafka.saic.com
Newsgroups: comp.unix.questions
From: mjo@ef2007.efhd.ford.com (Mike O'Connor)
Subject: Re: .netrc entry for default ftp connects
X-Disclaimer: Not an official spokesperson for Ford OPEO
Reply-To: Mike O'Connor <mjo@fmsrl7.srl.ford.com>
Organization: International Affairs, Overseas Engineering, "Fordz"
Date: Mon, 14 Sep 1992 17:48:10 GMT

In article <1992Sep12.184012.2519@lambda.msfc.nasa.gov>
thigpen@lambda.msfc.nasa.gov (Keith Thigpen) writes:

:.netrc works fine if I specify the machine that I want to contact. Often, tho,
:I want to jump out on the net and use anonymous ftp.
:
:I tried the word 'default' as a machine name, (seems like I vaguely remember
:that from the dim pas) but it has no effect. 

The functionality of .netrc depends greatly on the ftp client that you
are using.  FTP a modern ftp client from ftp.uu.net and you should be
all set.  :)

						...Mike

-- 
 Michael J. O'Connor           |  Internet:  mjo@fmsrl7.srl.ford.com
 Ford Motor Company, OPEO      |  UUCP:      ...!{backbone}!fmsrl7!mjo
 20000 Rotunda, Bldg. 1-3001   |  Phone:     +1 (313) 248-1260
 Dearborn, MI  48121           |  Fax:       +1 (313) 323-6277
From: rjm@Shiva.COM (Rich McMahon)
Newsgroups: comp.unix.questions
Subject: mail question
Date: 11 Sep 92 20:01:36 GMT
Distribution: usa
Organization: Shiva Corporation, Cambridge Ma, USA


I mistakenly typed a "d\" at the mail prompt.  Did this do what I think
it did, namely delete all the mail messages in mbox except for the  current
one?

Shiva.COM% mail -f
Mail version SMI 4.0 Wed Feb  7 23:50:57 PST 1990  Type ? for help.

& d\
\
/
& more
Message 145:
Message-Id: <9209110602.AA17916@Shiva.COM>
& more 20
20: Inappropriate message
& more 22
22: Inappropriate message
& more 23
23: Inappropriate message
& more 24
24: Inappropriate message
& q
"/s/usr1/users/support/rjm/mbox" complete
Shiva.COM% mail -f
Mail version SMI 4.0 Wed Feb  7 23:50:57 PST 1990  Type ? for help.
"/s/usr1/users/support/rjm/mbox": 1 message
>   1 phil               Fri Sep 11 02:58   35/1424
& z
On last screenful of messages
& q
From: kzhan@sgi1.mathstat.uoguelph.ca (Kaijun Zhan)
Newsgroups: comp.unix.questions
Subject: printer control
Date: 9 Sep 1992 15:50:53 -0400
Organization: Department of Mathematics & Statistics, Univ. of Guelph
Distribution: world
NNTP-Posting-Host: sgi1.mathstat.uoguelph.ca


I don't know if I can write a script file to control users printing. Let's say
I want to set a limit number of papers for each semester for each user since
some users are wasting papers too much. So whenever user invokes lpr,
a message of "you have 456 sheets left for this semster" will be displayed.

Thanks for any hint.

K. Zhan
From: wade@nb.rockwell.com (Wade Guthrie)
Newsgroups: comp.unix.questions
Subject: Re: How to justify texts on VI?
Date: 10 Sep 1992 17:25:00 GMT
Organization: Rockwell International


Certainly!  Without text on 'vi', what can you edit?  It's IMPORTANT
to have texts on 'vi', and this company should support it!  We need
texts on 'vi', because without them, the project will go over budget
and slip schedule.

How's that?

Wade
wade@nb.rockwell.com
:)
Newsgroups: comp.unix.questions,comp.sources.wanted
From: martin@datacomm.ucc.okstate.edu (Martin McCormick)
Subject: Re: Playing CD in workstation A, hearing it in B, Can I?
Organization: Oklahoma State University, Stillwater, OK
Date: Tue, 8 Sep 1992 05:24:06 GMT

if there is a utility that will play a CD on a Sun Sparc, it must be a
pretty sophisticated one.  CD's use 14-bit audio samples encoded with the
Reid-&-Solomon error correcting codes  at a sampling rate of 44.1KHZ for
each channel.  The audio channel on a Sun Sparc is an ISDN telephone 
subscriber IC which operates at a nominal rate of 8 thousand samples per
second.  Its digital samples are actually 12-bit samples, but the I/O works
in 8-bit samples, each one representing the change of audio level which
occurred between the present sample and the one just before it.  The samples
represent logarithmic values rather than linear ones.  This is to give the
chip the ability to handle large ranges of sound level.  The chip is capable
of operating using the Mu-Law or the A-Law method of piece-wise level handling.
In the U.S., ISDN telephones use Mu-Law conversion so the drivers that come
with Sun Sparcs are Mu-law.  Many other countries use A-Law conversion so
the binary sound files should take this into consideration when producing
a stream of samples to be sent to the ISDN chip.
	The bottom line, here, is that any utility to properly do this needs
to be a very sophisticated program.  It will probably also really eat CPU
time if it runs in real-time.

Martin McCormick WB5AGZ   Stillwater, OK
O.S.U. Computer Center Data Communications Group
From: spedpr@thor.cf.ac.uk (Paul Richards)
Newsgroups: comp.unix.questions
Subject: Re: .netrc entry for default ftp connects
Keywords: ftp netrc
Date: 14 Sep 92 15:40:44 GMT
Organization: University of Wales College at Cardiff
X-Mailer: Cardiff Computing Maths PP Mail Open News Gateway

In article <smr.716471679@hitkw14> smr@hitkw14.pki-nbg.philips.de (S.Riehm) writes:
|netrc(4)
|
|    default             This is the same as 'machine name' except that
|			default matches any name.  There can be only
|			one default token, and it must be after all
|			machine tokens.  This is normally used for
|			ftp as follows:
|
|			default login anonymous password user@site
|
|			This provides automatic anonymous FTP login
|			to machines not specified in .netrc.  This
|			can be overridden in ftp by using the -n flag
|			to disable auto-login.
|---
|
|need I say more?

Yeah, well that works on my 386BSD machine but it won't work under
ULTRIX. The man page is different and I've tried a few permutations but
none of them work. The instructions are radically different, bsd says
put the default last, which makes sense to me, Ultrix says put it first.

Anyone know how to get this working under ultrix?

-- 
  Paul Richards at Cardiff university, UK.

  spedpr@uk.ac.cf.thor	Internet: spedpr%thor.cf.ac.uk@nsfnet-relay.ac.uk
  UUCP:     spedpr@cf-thor.UUCP or ...!uunet!mcsun!uknet!cf!thor!spedpr
+++
From: dkowalsk@usdsd1.DaytonOH.NCR.COM (Dennis Kowalski)
Newsgroups: comp.unix.questions
Subject: malloc(3) library
Date: 11 Sep 92 19:36:23 GMT
Reply-To: dkowalsk@usdsd1.DaytonOH.NCR.COM (Dennis Kowalski)
Distribution: world
Organization: NCR USG Data Services Division


In <dbt.714876030@otto> Dave T. Bath states that the malloc(3) library
is faster than the default malloc routines.

I wrote the following test program


#include <malloc.h>

main()
{
int x,y;
char *p_str1, *p_str2, *p_str5, *p_strx, *p_stry, *p_strz;

long ticks1, ticks2;


GETCPUTICKS(ticks1);    /* a library routine we have */

for (x=0; x<25000; x++)
{
  p_str1 = (char *) malloc(10000);
  p_str2 = (char *) malloc(2000);
  p_str5 = (char *) malloc(15000);
  p_strx = (char *) malloc(90000);
  p_stry = (char *) malloc(6000);
  p_strz = (char *) malloc(150000);
  free(p_strx);
  free(p_str2);
  free(p_str1);
  free(p_str5);
  free(p_stry);
  free(p_strz);
}  /* for x */

GETCPUTICKS(ticks2);    /* a library routine we have */

printf("\nTest 1 ticks = %d\n",(ticks2 - ticks1));

}


 and tried it with each malloc routine.

 The results were very surprising to say the least.


This is the cpu time in ticks (60 ticks per second) using the
default malloc routines.

Test 1 ticks = 146

This is the timex output for it.

real        7.01
user        2.81
sys         0.18

This is the cpu time in ticks (60 ticks per second) using the
-lmalloc option in the make.

Test 1 ticks = 432

This is the timex output for it.

real       20.16
user        7.51
sys         0.40



As you can see, the malloc(3) routines which are supposed to be faster,
are over 3 times slower!!!!!!

The tests were done on NCR TOWER 700 with SVR 5.3 and an NCR 3445 with 5.4.
Both had similar results.

Any ideas as to what is happening ???

-- 
Dennis Kowalski         NCR Corporation  PCD-3                  (513) 445-1843
Systems Architecture    1700 S. Patterson Blvd              VOICEplus 622-1843
USG Data Services Div   Dayton, Ohio     45479
Dennis.Kowalski@DaytonOH.NCR.COM
Newsgroups: comp.unix.questions,comp.unix.misc
From: efichtne@dante.nmsu.edu (FICHTNER)
Subject: SLIP for small systems?
Organization: The 9th Floor BBS - "High Weirdness in Cyberspace" 505/522-0390
Date: Sun, 13 Sep 1992 18:22:02 GMT

Hi, I've been looking at KA9Q for Slip purposes for a couple of machines 
here in my home.  However, KA9Q only seems to be a slip client, as in, it
only does slip on the 'slave' end.  What I really need is a program I can
run that will do the OTHER end of a slip connection.. the slip server if
you will.    Here's an example situation:
	I have small unix box. 
	friend has dos box with ka9q.
	we'd like to establish a slip connection between these two 
machines over a telephone link.   

Is there something that can do this?  on either end?  ka9q is available 
for all the machines in question, so if there's a program the does the
other half for any platform, please let me know...
 
Please respond in email to techs@pioneer.unm.edu (preferred) or
efichtne@dante.nmsu.edu since I don't think this site gets comp.unix.questions
and c.u.misc gets tons of posts. <grin>
 
Thanks a bunch,
Erik..

Newsgroups: comp.unix.questions
From: rayj@Celestial.COM (Ray Jones)
Subject: Re: Replacing words
Organization: Celestial Software, Mercer Island, WA
Distribution: usa
Date: Mon, 14 Sep 1992 16:57:25 GMT

In <6937@tekig7.PEN.TEK.COM> naren@tekig5.pen.tek.com (naren) writes:

>Hi,

>I was trying to replace occurrences of XXX with another word YYY.
>I was able to do it two ways.

>1.  I went into the vi editor.
>    /XXX
>   [ESC] cw
>   Then I kept hitting n and .

>2. I wrote a macro in vi.
>The basic structure was as follows.
>map v: /XXX cw YYY 

>3. I tried out a third one.
>This one did not work for some reason.

>:$s /XXX/YYY/g

>If anyone can come up with better ways, email me

Your last command said "on the last line of the file, make the sub.
on all occurances in the line.
What you want is
:%s/XXX/YYY/g
for all occurances on the line, or;
:%s/XXX/YYY/
for the first occurance on the line.
The symbol "%" means for the entire file and means the same as;
:1,$s/XXX/YYY/
or from line 1 to the end of the file.
-- 
Onager Systems			 Ray A. Jones
18710 NE 59th Ct.		UUCP .....uunet!camco!onager!ray
# 2053       			...ray@onager.Celestial.COM
Redmond, WA 98052               206-885-3568