HDTenEightyP/NetNews huggingface dataset:
From: jf41+@andrew.cmu.edu (Jonathan R. Ferro)
Newsgroups: comp.unix.questions
Subject: Re: Changing file names
Date: 20 Aug 92 00:14:17 GMT
Article-I.D.: andrew.ceYpFNG00VoxBKON4O
Organization: Carnegie Mellon, Pittsburgh, PA

bosak@netcom.com (Jon Bosak) writes:
> [ file name conversion: xyz920815a ==> 920815a ]
>
> Who can provide the most elegant solution using just the basic Unix
> tools (cp, mv, sed, awk, sh, csh)?

Put this in your bin directory under the name 'rename':
----------
#!/usr/local/bin/perl

# Usage: rename perlexpr [files]
# As stolen from the perl distribution.

($op = shift) || die "Usage: rename perlexpr [filenames]\n";
if (!@ARGV) {
    @ARGV = <STDIN>;
    chop(@ARGV);
}
for (@ARGV) {
    $was = $_;
    eval $op;
    die $@ if $@;
    rename($was,$_) unless $was eq $_;
}
----------

and use the command:

% rename 's/^xyz//' xyz*

Unless, of course, you don't consider perl to be a "basic" Unix tool, in
which case you're hopelessly behind the times.  :-)

--
Jon Ferro		MIT Transportation Modelling Research Center (TMRC)
jf41+@andrew.cmu.edu	"We can hack it!"
SGNTR VRS VRSN 3.1B: Strppd nd cmprssd fr qckr trnsmssn! nfct yrs tdy!
From: sgr@alden.UUCP (Stan Ryckman)
Newsgroups: comp.unix.questions
Subject: Re: Fun with sed!!!! [nothing better to do on Saturday night]
Date: 17 Aug 92 16:28:48 GMT
Organization: Alden Electronics, Westboro, MA

In article <1992Aug10.192853.3209@kopachuk.uucp> dcb@kopachuk.uucp (David Breneman) writes:
>In article <1992Aug2.152356.7333@news.acns.nwu.edu> navarra@casbah.acns.nwu.edu (John Navarra) writes:
>>
>>
>>For today's sed problem let us go all the way back to early grade school
>>where we heard the famous rule:
>>
>>'I' before "E" except after "C".
>>
>>This is the rule I want to implement in sed. So far, here is my progress:
>
>Process deleted...
>
>>Wonderful, Wonderful! I needed to misspell words in order to correct
>>other words, then change all the misspelled words back in addition to
>>other misspelled words just like them!  
>
>When you get up, you can try adding the second half of the rule:
>
>"...or sounding like "A" as in neighbor or weigh."

Oh, it gets a lot worse than that.
How do you pronounce "either?"
Does anyone named "Neil" pronounce his name as if "Nail?"

In fact, I ran "egrep -i '(^|[^c])ei' /usr/dict/words"; the
first few (of 213 matches) are:
	absenteeism	<- not "A" sound
	Aeneid		<- not "A" sound
	agreeing	<- not "A" sound
	albeit		<- not "A" sound
	Alexei		<- not "A" sound
	Anaheim		<- not "A" sound
	Andrei		<- I don't know
	aniseikonic	<- I have no idea!
	apartheid	<- not "A" sound
	atheism		<- not "A" sound"
	atheist		<- not "A" sound


What would Einstein think about this "rule?"   :-)
           ^^   ^^
>
>Be sure to post your solution. :-)

Yeah, especially if you can find one that will get all these
words right!  :-) :-)

Stan.
--
This .signature has expired.  Call 1-900-YOU-FOOL to find out why.
    Stan Ryckman   sgr@alden.UUCP
Newsgroups: comp.unix.questions,comp.unix.wizards
From: ernst@opal.cs.tu-berlin.de (Ernst Kloecker)
Subject: Anybody knows STRATOS computers or OS ?
Organization: Techn. University of Berlin, Germany
Date: Wed, 19 Aug 1992 09:04:49 GMT

Hi everybody,

I am looking for any info on STRATOS computers and their OS. As far as I
know they are fault-tolerant Unix machines. Does anybody know
which flavour of Unix they use and whether one can connect them tothe Internet
using standard Unix methods (TCP/IP, NFS and uucp).

Thanks for any info, Ernst.
--

-----------------------------------------------------------------------------
Ernst Kloecker      phone: ++49-30-6181635      e-mail: ernst@cs.tu-berlin.de
-----------------------------------------------------------------------------
From: digdon@ug.cs.dal.ca (Mike Digdon)
Newsgroups: comp.unix.questions
Subject: Man pages
Date: 21 Aug 92 14:54:25 GMT
Organization: Math, Stats & CS, Dalhousie University, Halifax, NS, Canada


I apologize deeply for all of the waste of bandwidth, but I am not having
a good day..
I got a response from someone about my question, and it was the answer I was
looking for. I then sent mail to that person thanking them.. then, before
I could save it, /var at my site crashed and I lost the mail message..
and of course, I can't remember his name or address..

So, if you see this, could you send me what you sent the first time?
Thanx..

Again, I apologize for this..
-- 
	     Mike Digdon - Vice Prez DSCSS - Dalhousie University
		     digdon@ug.cs.dal.ca  -- Halifax, NS
		 - Real programmers never work nine to five -
Xref: sparky comp.unix.questions:10137 comp.unix.programmer:4339
From: cxk6819@hertz.njit.edu (K. Chandrakanth)
Newsgroups: comp.unix.questions,comp.unix.wanted,comp.unix.programmer
Subject: Regarding Unix Networking...
Date: 17 Aug 92 19:31:02 GMT
Organization: New Jersey Institute of Technology, Newark, N.J.
Originator: cxk6819@hertz.njit.edu

Dear netters,

	Can you please tellme where I can find the solutions for
the problems in Unix Network Programming by Ricard Stevens. It
will be really very much help to me.

chandrakanth.
cxk6819@hertz.njit.edu

-- 
god's theorem:
		those who sow in tears will reap in joy.
Newsgroups: comp.unix.questions
From: peter@close.demon.co.uk (Peter Curran)
Subject: ms text macros
Distribution: world
Organization: Close Consultants
Date: Sat, 22 Aug 1992 13:25:15 +0000

I am in the process of setting up a system based on the Jolitz 386BSD
release.  This does not appear to have the ms macro package included.

Is this available from somewhere please?

thanx
peter

-----------------------------------------------------------------------------
Peter Curran                                   Mail: peter@close.demon.co.uk
Close Consultants          'Not necessarily the ravings of a completely sane
Dorking,UK                    person - but better than most politicians....'
-----------------------------------------------------------------------------
From: digdon@ug.cs.dal.ca (Mike Digdon)
Newsgroups: comp.unix.questions
Subject: Man Stuff (again)
Date: 20 Aug 92 21:19:26 GMT
Organization: Math, Stats & CS, Dalhousie University, Halifax, NS, Canada


From all of the responses I have received, it is obvious that I didn't say
what I wanted the right way.. what I meant to say is that there is a
list somewhere in man that lists the different sections and says what each
section represents (such as 3v being C commands.. or is 2v.. see why I need
the list?)
Well, if you can help me now (now that I have stated correctly what I wanted)
send me some mail (or post.. whatever..).. thanx..
-- 
	     Mike Digdon - Vice Prez DSCSS - Dalhousie University
		     digdon@ug.cs.dal.ca  -- Halifax, NS
	  - Real programmers don't comment code. If it was hard to -
		  - write, it should be hard to understand. -
Newsgroups: comp.unix.questions
From: nickel@cs.tu-berlin.de (Juergen Nickelsen)
Subject: Re: Changing file names
Reply-To: nickel@cs.tu-berlin.de
Organization: STONE Project, Technical University of Berlin, Germany
Date: Thu, 20 Aug 1992 15:49:12 GMT

In article <ac#n06l.bosak@netcom.com> bosak@netcom.com (Jon Bosak)
writes:

> Suppose I have a directory containing files named, for example,
>
>       xyz920815a
[...]
>       xyz920818b
>
> ...and so on.  I want to change the names of these files to
>
>       920815a
[...]
>       920818b
>
> ...and so on.  Simple, right?  Just chop off the first three
> characters and there you are.  But how is it done?

There have some solutions been posted, which are undoubtedly suited
for this task, but all of them used non-standard tools -- nawk, perl,
ksh. This isn't necessary, it can be done with even the most basic
UNIX tools -- sh, sed, mv. I guess there isn't any reasonable UNIX
system delivered without these.

This is my ~/bin/rename:
---------cut here----------cut here------------cut here---------------
#!/bin/sh
# rename files using an sed command.
# common usage: rename s/from/to/ 

iflag=
case "$1" in
    -i)	iflag=-i
	shift ;;
esac

if [ $# -le 1 ] ; then
    echo Usage: rename sed-command file ...
    exit 1
fi

regexp="$1"
shift
for i in "$@" ; do
    if [ "$i" != "`echo $i | sed \"$regexp\"`" ] ; then
	mv $iflag "$i" "`echo $i | sed \"$regexp\"`"
    fi
done
---------cut here----------cut here------------cut here---------------

A still remaining problem is the quoting of funny characters in the
argument strings -- there are probably some examples still defeating
this script.

--
Juergen Nickelsen
Newsgroups: comp.unix.questions
From: rg3h@uvacs.cs.Virginia.EDU (Rich Gossweiler)
Subject: Wanted: a way to send data from a UNIX box to a Mac
Reply-To: rg3h@Virginia.EDU
Organization: University of Virginia Computer Science Department
Date: Fri, 14 Aug 1992 00:12:47 GMT

One of our current projects requires us to send data from an SGI to a
Macintosh via TCP. We have experimented with Macintosh sockets, but so
far haven't found any that compile under our Think C compiler.

We`re using ThinkC 5.0 and system 7 on the Mac.  We've written a UNIX
socket interface on the SGI side.  Any suggestions or pointers to Mac code
would be greatly appreciated.

Thanks,
Rich

-- 
Rich Gossweiler (rg3h@cs.Virginia.EDU) | Education is mostly cleaning
CS Department, Olsson Hall             | erasers and waiting for lunch.
The University of Virginia             | 		-- Joe Bazooka
Charlottesville, Virginia 22903        |
Newsgroups: comp.unix.questions
Subject: Shared memory baby question on ultrix 4.2
From: aipost@otago.ac.nz
Date: 17 Aug 92 15:22:07 +1300
Organization: University of Otago, Dunedin, New Zealand

Help Help Help

!!!! please e-mail me at deano@piglet.otago.ac.nz not the posting address

I don't understand shared memory.  Sorry, but all I can find in the
documentation for our DECstations is the man pages which tell me what to use
and what to pass but not HOW to use ?!?!?!?!?!?

I am using Ultrix 4.2 etc ...... on DECstation 5000/200's

at the moment I do this :

key = ftok("/tmp", 'a');
shmid = shmget(key, 64, IPC_CREAT | IPC_EXCL);
s = shmat(shmid, 0, SHM_R | SHM_W);

*s = 1; /* BARF BARF BARF, kernel acces since s == -1 */

help help help 

sorry this is probably a really dumb question on the wrong roup
but hey it's all I know how to do !!!!

deano

p.s: please e-mail me at deano@piglet.otago.ac.nz not the posting address
-- 
==============================================================================

                              "The AI Kids"
                     Department of Computer Science
                           University of Otago
                               New Zealand
                       Internet: AIPOST@otago.ac.nz
Newsgroups: comp.unix.questions
From: qb7g6@fel.tno.nl (Maarten Landzaat)
Subject: SUMMARY: Etymology of "finger"
Organization: TNO Physics and Electronics Laboratory
Date: Tue, 11 Aug 1992 15:20:24 GMT


A couple of days ago, I asked the net why "finger" is called "finger".
Here's a summary of the most serious answers:

************************
"Finger" is an old slang verb used by mobsters.  To finger someone is
to "name" them, to reveal "who did it", to implicate them by name,
or to disclose information about them.
*************************
For the benefit of all of us AESLers(*) who have wondered about this,
the American Heritage Dictionary sez
  finger (noun)     1. <sausage-shaped thing on your hand definition>
                    ..
         (tr. verb) ..
                    5. (Slang) to inform on 
                               ^^^^^^^^^^^^

* AESL = American English as a second language.  Many Brits are AESLers.
***********************
Since fingers are used to point with, an American English slang expression
has emerged which uses the word "finger" as a verb rather than a noun.
It means to identify.  In a gangster movie, somebody might say, "Bob went
to the police and fingered Joe as the one who had the goods."
In Unix, it means nothing more sinister than to identify.
**********************
Look in the dictionary.  Finger is also a verb, meaning "to touch".
*****************
	Well, I myself think of 'finger' as a probe into a system, who
is active there and doing what.  When you finger a particular 
person, you get more specific info on that person, if available.  So,
in this case, I think finger is analogous to probing or prodding something.
********************

Thanks everybody!
-- 
Maarten J. Landzaat (analyst/programmer, bass player, Atari/midi freak)
BSO/Aerospace & Systems			Mail: Spuistraat 97
Email: maarten.landzaat@fel.tno.nl	      1012 SV  Amsterdam
Phone: +31 20 6266098			      The Netherlands
From: edwards@ee.fit.edu (John Edwards)
Newsgroups: comp.unix.questions
Subject: Re: Digiboard & UUCP
Date: 18 Aug 92 08:00:37 GMT
Organization: Florida Tech, CP/EE Dept.

In <1992Aug14.204211.5918@zeos.com> kgermann@zeos.com (Ken Germann) writes:


>We have a DIGICON C/X. I set up the ports for the modem. The modem
>drops the connection as soon as it detects a carrier. I have the
>RTS CTS TX RX and GROUND being used on the DIGIBOARD connections.
>Any suggestions on getting this to work? 
>-- 
>  	   New! ZEOS 486 Upgradable VESA Local Bus Motherboard.  

>			   info@zeos.com
>Ken Germann		support@zeos.com 	Zeos International, Ltd.

If your modem is set to hangup when DTR is low, then it could very well
hangup the instant it goes into data mode.

Possible solutions are:
1)  set the modem to ignore DTR, either by dip switchs, or in the case of
    some Hayes compatible modems, the command AT&D0&W

2)  connect the DTR pin of the modem to the Digiboard to the DTR input
    of the modem.  The only Digiboard I ever used had a DTR pin for
    every port.

3)  Jumper the DTR pin high in the cable.  One way to do this is to connect
    the DTR input to the DSR output of the modem.  Pin 6 to Pin 20 in the
    standard RS-232 25 pin plug.
Newsgroups: comp.unix.questions
From: aegl@ossi.com (Tony Luck)
Subject: du blocksize=512 (Was: Simple AWK question)
Organization: Open Systems Solutions Inc.
Date: Fri, 21 Aug 1992 08:20:02 GMT

Tom Christiansen <tchrist@convex.COM> writes:
>Can anyone explain WTF POSIX.2 decided that utilities should report
>things in demikilobytes instead of real k which we all are more
>likely to think in?  

Suppose you have a file system with zillions of little tiny files (for
example /usr/spool/news).  You figure that you can keep the disk
usage down (and thus the expiry time up) by making the filesystem with
a 512 byte block size (or fragment size).  Now, if you have a "du" that
only thinks in Kbytes, it won't give you the right answer when you want
to know how much disk space will be freed up if you blow away all of
"alt/useless/bogus/groups".

-Tony Luck <aegl@ossi.com>
From: dwj@sactoh0.sac.ca.us (Daniel W. James)
Newsgroups: comp.unix.questions
Subject: Re: vi will not open large files
Keywords: UNIX System V/386 Ver 3.2 Rel 2.3
Date: 20 Aug 92 16:46:13 GMT
Distribution: na
Organization: Sacramento Public Access Unix

gwt@cbnewsl.cb.att.com (geoffrey.c.woods) writes:


>This question probably has a very simple solution, but I can't seem to 
>figure it out. The problem is that vi will not create a /tmp file larger
>than 518144 characters, so I cannot edit files over approximately 300K.

I have this problem quite often.  The simplest solution I can think of is
to "split" the file into smaller pieces, edit the pieces, and then "cat"
them back together.
-- 
_________________________________________________________________________
Some folks try to multiply from sunrise to  |          dwj@sactoh0.SAC.CA.US
Sunset--leave behind more of their kind so  |       ames!pacbell!sactoh0!dwj
no one will forget             -- Level 42  |(This space available for rent)
Newsgroups: comp.unix.questions
From: hunt@dg-rtp.rtp.dg.com (Greg Hunt)
Subject: Re: Changing file names
Date: Thu, 20 Aug 92 20:26:25 GMT
Reply-To: hunt@dg-rtp.rtp.dg.com
Organization: Data General Corp., Research Triangle Park, NC

In article <ac#n06l.bosak@netcom.com>, bosak@netcom.com (Jon Bosak) writes:
> 
> Here's a problem that must be very common but doesn't seem to get
> discussed in books for Unix novices.
> 
> Suppose I have a directory containing files named, for example,
> 
>       xyz920815a
>       xyz920815b
>       xyz920816
>       xyz920817
>       xyz920818a
>       xyz920818b
> 
> ...and so on.  I want to change the names of these files to
> 
>       920815a
>       920815b
>       920816
>       920817
>       920818a
>       920818b
> 
> ...and so on.  Simple, right?  Just chop off the first three
> characters and there you are.  But how is it done?

Here's one way:

#!/bin/sh
for Tmp in xyz*
do
    mv $Tmp `echo $Tmp | awk '{print substr ($1, 4)}'`
done

-- 
Greg Hunt                            email: hunt@dg-rtp.rtp.dg.com
DG/UX Core Development
Data General Corporation
Research Triangle Park, NC, USA      These opinions are mine, not DG's.
Newsgroups: comp.unix.questions
From: iwsbarke@acs.ucalgary.ca (I W Scott Barker)
Subject: why use eval?
Date: Fri, 14 Aug 92 19:52:42 GMT
Organization: The University of Calgary, Alberta, Canada
X-Newsreader: Tin 1.1 PL5

What is the significance of using eval `[command]`? The man pages state that
this runs the command [command] in the shell. Does not simply typing the
command alone accomplish the same thing?

--
Scott Barker
barker@enel.ucalgary.ca

"Remember, wherever you go, there you are."
   - Peter Weller, The Adventures of Buckaroo Banzai Across the 8th Dimension!
Newsgroups: comp.unix.questions
From: bx955@cleveland.Freenet.Edu (Michael Todd Glazier)
Subject: Using Awk in a Scrabble(c) Utility.
Reply-To: bx955@cleveland.Freenet.Edu (Michael Todd Glazier)
Organization: Case Western Reserve University, Cleveland, OH (USA)
Date: Sat, 15 Aug 92 21:22:52 GMT


I'm a novice Unix dude trying to write a tiny (and very messy)
Unix util that takes a list of letters as the parameter and 
makes as many words out of those letters as it can, !BUT!, with
out using any letters twice, unless they are specified in the
list of letters.

Here's what I've done, or perhaps I should say, learned to do, so far.


$ cat sc
cat /usr/dict/web2 | egrep '^['$1']['$1']?['$1']? etc (repeated for as many
squares across a scrabble board is.)

What I get is close to what I need. It does give me all the words that
that $1 makes up, but it uses any letters it feels like more than once.

What I'd like to do is make second filter, I think it'll have to be awk,
that'll check the words against the letters input, and keep the words that
supposed to duplicate letters, get the rid of the one that shouldn't have
duplicate letters, and pass that on to STDOUT.

Or am I just in over my head?

BTW, I'm using NeXT Unix, which seems to me be pickier than most other flavors
of Unix.

Michael Todd
bx955@cleveland.freenet.edu
-- 

Newsgroups: comp.unix.questions
From: avery@Ecosys.DRDR.Virginia.EDU (Daniel Avery)
Subject: Re: Wanted: simple mail sorter & header stripper
Organization: Division of Recoverable and Disposable Resources, U.Va.
Date: Sat, 22 Aug 1992 02:30:57 GMT

In article <1992Aug22.022506.11647@murdoch.acc.Virginia.EDU> avery@Ecosys.DRDR.Virginia.EDU (Daniel Avery) writes:
>Sorry to bother everyone on the net with a simple question, but
>I have an urgent need for a simple utility to sort mail files
>by date and strip the headers...I'd knock one off myself but I
>need it very quickly...Does anyone know of any ready-made utilities
>to sort and strip mail files?  Reply via e-mail - no need to waste
>net space more than absolutely necessary...
>
>Thanks,
>Dan Avery
>Division of Recoverable and Disposable Resources
>University of Virginia
>internet: avery@ecosys.drdr.virginia.edu
>bitnet:   dba3k@virginia
>

oops!  I forgot to mention...I'm running under SunOS 4.1.1...
Dan Avery
avery@ecosys.drdr.virginia.edu
From: merlyn@romulus.reed.edu (Randal L. Schwartz)
Newsgroups: comp.unix.questions
Subject: Re: executing down directory tree
Date: 14 Aug 92 14:26:10 GMT
Organization: Reed College

In article <1992Aug14.030634.12814@amhux2.amherst.edu> twpierce@amhux1.amherst.edu (Tim Pierce) writes:
   Indeed it wasn't, in which case rm -rf sub-dir-name would be terrible
   advice.  All systems I've been on -- and I would think any moderately
   sane system -- defaults to interactive mode for rm -r.

If your rm is in interactive mode, some unthinking but bighearted
system administrator created an alias to overload the "rm" command to
assist lame users like you so that he/she wouldn't have to do as many
file restores.  But such an admin forgets that sometimes you get
popped into a real shell (/bin/sh), and when you try an "rm" there...
boom, no interactivity, and away go your files.

PLEASE DON'T OVERLOAD STANDARD COMMANDS WITH ALIASES.

Sysadms, if you want an interactive rm, create an alias called "del"
and tell people to do *that* instead of rm.  Then at least the worst
that would happen is that it would say "del: not found" instead of
blasting all the files away.

Grumble, grumble. No wonder people think Unix is hard to learn. Sheesh.

Just another Unix hacker since 1977,
--
Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
merlyn@reed.edu (guest account) merlyn@ora.com (better for permanent record)
cute quote: "Welcome to Portland, Oregon -- home of the California Raisins!"
Newsgroups: comp.unix.questions
From: les@chinet.chi.il.us (Leslie Mikesell)
Subject: Re: Using KKermit with cu
Organization: Chinet - Public Access UNIX
Date: Wed, 12 Aug 1992 14:53:35 GMT

In article <4408@news.duke.edu> ndd@bal1 (Ned Danieley) writes:
>
>any idea where 5a is available? I asked archie about kermit, but
>none of the sites I checked have the version number in the file
>name, and I hate to just grab copies until I happen to hit on 5a.

I'm sort of internet-impaired myself, but the place to look would
be on watson.cc.columbia.edu in the test directory.  I think it's
also on uunet in the communications directory and in the free
386BSD distribution, and somewhere on okstate's kermit/uucp server
machine.

Les Mikesell
  les@chinet.chi.il.us
Newsgroups: comp.unix.questions
From: gja@mullian.ee.mu.oz.au (Grenville Armitage)
Subject: Re: Swap space usage..??
Organization: Basket Weavers, Inc.
Date: Fri, 21 Aug 1992 00:38:26 GMT

In article <27434@sophia.inria.fr> rriv@oural.inria.fr (Robert Riviere) writes:
	[...]
>myhost%df
>Filesystem            kbytes    used   avail capacity  Mounted on
>...
>swap                   36828     952   35876     3%    /tmp
>...
>What is my swap size ? 60 Mo, 40Mo or 36 Mo ...

I don't know how you got a device listed here as "swap", but if it's
mounted on /tmp then it ain't swap space.

Look for an entry listed as "swap" in /etc/fstab for another partition
being used as swap space. (mentioned by a previous poster).

gja
From: rdorich@jade.tufts.edu (Rob)
Newsgroups: comp.unix.questions
Subject: Re: csh foreach question
Date: 13 Aug 92 14:41:33 GMT
Organization: Tufts University - Medford, MA

you wrote:
>foreach line (`cat this_script`)
>  echo "$line"
>end
[more]

And you were wondering why does it print one word per line.  That is
the correct behaviour, foreach takes every word as an item to work
with. So, for example if you do foreach i (`echo line_above`)
this will be equal to foreach i (the correct behaviour....).
So the loop will go throug for 'the' 'correct' ....
Hope this helps

Rob
--

-------------------------------------------------------------------------------
Roberto Dorich           |           /~~  \ /  ~~/~~ /~~/  /~~  /|  /    /~~
                         |    SKI   /--    X    /   /__/  /--  / |/ |   /--
rdorich@jade.tufts.edu   |         /__    / \  /   /\    /__  /     |  /__
-------------------------------------------------------------------------------