Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

(none)

3 views
Skip to first unread message

REGI's

unread,
Oct 14, 1992, 3:01:15 PM10/14/92
to
>X-Envelope-to: INFO...@BRL.mil
>X-VMS-To: IN::"INFO...@BRL.mil"

1
13-OCT-1992 13:26:56.35
1 00:00:00.00
14-OCT-1992 13:26:56.35
info-uni...@sem.brl.mil
raf...@obelix.cica.es

Received: from SEM.BRL.MIL by ESEVVX.CICA.ES ; 10-OCT-1992 13:26:54.93
Received: from SEM.BRL.MIL by SEM.BRL.MIL id aa02348; 10 Oct 92 6:59 EDT
Received: from wharf.brl.mil by SEM.BRL.MIL id aa02295; 10 Oct 92 6:44 EDT
Received: from hearn.nic.surfnet.nl by WHARF.BRL.MIL id aa18771;
10 Oct 92 6:32 EDT
Received: from IRUCCIBM.BITNET by HEARN.nic.SURFnet.nl (IBM VM SMTP V2R2)
with BSMTP id 7367; Sat, 10 Oct 92 11:33:46 CET
Received: from IRUCCVAX.UCC.IE (SCCS6075) by IRUCCIBM.BITNET (Mailer R2.08)
with BSMTP id 2933; Sat, 10 Oct 92 11:35:01 IST
Received: from IRUCCVAX.UCC.IE by IRUCCVAX.UCC.IE (PMDF #12095) id
<01GPS5CUH...@IRUCCVAX.UCC.IE>; Sat, 10 Oct 1992 11:13 GMT
Date: Sat, 10 Oct 1992 11:13 GMT
From: David O'Byrne <SCCS...@bureau.ucc.ie>
Subject: can a files protection be set so that it is writeable but not
deleteable ?
To: INFO...@BRL.MIL
Message-id: <01GPS5CUH...@IRUCCVAX.UCC.IE>
X-Envelope-to: INFO...@BRL.mil
X-VMS-To: IN%"INFO...@BRL.mil"

well the subject line says it all, I have an important document, that needs
modifying, but I also want to protect it against inadvertent deletion...

thanks

...david

----------------------------------------
David O'Byrne : sccs...@iruccvax.ucc.ie
----------------------------------------

REGI's

unread,
Oct 14, 1992, 3:11:37 PM10/14/92
to
>X-Envelope-to: Info...@BRL.mil
>X-VMS-To: IN::"Info...@BRL.MIL"

1
12-OCT-1992 16:39:11.05
1 00:00:00.00
13-OCT-1992 16:39:11.05
info-uni...@sem.brl.mil
raf...@obelix.cica.es

Received: from SEM.BRL.MIL by ESEVVX.CICA.ES ; 9-OCT-1992 16:39:09.08
Received: by SEM.BRL.MIL id aa19659; 9 Oct 92 10:29 EDT
Received: from SEM.BRL.MIL by SEM.BRL.MIL id aa17549; 9 Oct 92 8:41 EDT
Received: from wharf.brl.mil by SEM.BRL.MIL id aa17405; 9 Oct 92 8:24 EDT
Received: from pol88a.polito.it by WHARF.BRL.MIL id aa11127; 9 Oct 92 8:20 EDT
Received: from EI3500.CSELT.IT by POLITO.IT (PMDF #12666) id
<01GPQQGEV...@POLITO.IT>; Fri, 9 Oct 1992 10:55 GMT+1
Received: from beatles.uf.cselt (125.0.90.142) by EI3500.CSELT.STET.IT; Fri,
9 Oct 92 10:55 GMT +1
Received: by beatles.uf.cselt (4.1/SMI-4.1) id AA24183; Fri,
9 Oct 92 10:56:08 +0100
Date: Fri, 9 Oct 92 10:56:08 +0100
From: m...@beatles.cselt.stet.it
Subject: weird behaviour of sed
To: Info...@BRL.MIL
Message-id: <921009095...@beatles.uf.cselt>
X-Envelope-to: Info...@BRL.MIL

My man page (SunOs 4.1.2) for sed says that
s/regular expression/replacement/flags
change the regular expression into the replacement and defers to ed(1).
ed says that it is the first occurrence of a string which match the RE to be
substituted. Fine.

So, if z is a file containing the line
asdfgh asdgfh asdfgh asdgfh asdfgh asdgfh
the command sed 's/.*gf/GF/1' z should return
GFh asdfgh asdgfh asdfgh asdgfh
, shouldn't it? Well, it returns just GFh .

Which is the reason of this behaviour? and how can I accomplish my goal?

regards, .mau.

REGI's

unread,
Oct 14, 1992, 3:23:16 PM10/14/92
to
>X-Envelope-to: INFO...@BRL.mil
>X-VMS-To: IN::"INFO...@BRL.MIL"

1
12-OCT-1992 23:16:44.37
1 00:00:00.00
13-OCT-1992 23:16:44.37
info-uni...@sem.brl.mil
raf...@obelix.cica.es

Received: from SEM.BRL.MIL by ESEVVX.CICA.ES ; 9-OCT-1992 23:16:43.52
Received: from SEM.BRL.MIL by SEM.BRL.MIL id ab29354; 9 Oct 92 16:50 EDT
Received: from wharf.brl.mil by SEM.BRL.MIL id ab25562; 9 Oct 92 14:29 EDT
Received: from cearn.cern.ch by WHARF.BRL.MIL id aa13274; 9 Oct 92 14:09 EDT
Received: from tifrvax.bitnet by CEARN.cern.ch (IBM VM SMTP V2R2)
with BSMTP id 8257; Fri, 09 Oct 92 19:10:26 SET
Date: Fri, 9 Oct 92 23:06 IST +0530
From: "DARSHAN G. MAHARANA" <DGM%tifrvax...@cearn.cern.ch>
Subject: Re: INFO-UNIX Digest V16#020
To: INFO...@BRL.MIL
Message-id: <E2501864A...@tifrvax.bitnet>
X-Envelope-to: INFO...@BRL.MIL
X-VMS-To: IN%"INFO...@BRL.MIL"
X-VMS-Cc: DGM

REGI's

unread,
Oct 15, 1992, 8:42:34 AM10/15/92
to
>X-Envelope-to: INFO...@BRL.mil
>X-VMS-To: IN::"INFO...@BRL.MIL"

1
16-OCT-1992 00:08:47.44
1 00:00:00.00
17-OCT-1992 00:08:47.44
info-uni...@sem.brl.mil
raf...@obelix.cica.es

Received: from SEM.BRL.MIL by ESEVVX.CICA.ES ; 13-OCT-1992 00:08:20.33
Received: from SEM.BRL.MIL by SEM.BRL.MIL id ab16616; 12 Oct 92 15:25 EDT
Received: from sem.brl.mil by SEM.BRL.MIL id aa16596; 12 Oct 92 15:15 EDT
Date: Mon, 12 Oct 92 15:15:36 EST
From: The Moderator (Mike Muuss) <Info-Uni...@BRL.MIL>
To: INFO...@BRL.MIL
Reply-To: INFO...@BRL.MIL
Subject: INFO-UNIX Digest V16#036
Message-ID: <921012151...@SEM.BRL.MIL>

INFO-UNIX Digest Mon, 12 Oct 1992 V16#036

Today's Topics:
Re: unbuffered stdout
Unix Talk
Re: IS UNIX DEAD?
Re: can a files protection be set...
winter 93 usenix info wanted
Re: 'w' command
Re: Which group is for SCO 3.2.4
Re: A QUESTION
bind() fails 2nd time prog run, how to fix it?
Re: copying a file without login
tset when term=vt300? (rephrased repost)
Re: tset when term=vt300? (rephrased repost)
UnixWare from Univel
/dev/audio permissions
Re: What does 'daemon' mean?
Removing inodes?
Any Good Book(s) about [Advance] "C" on Unix ?
Re: Any Good Book(s) about [Advance] "C" on Unix ?
Re: Sockets and stuff
Re: What does cc -D option means ?
Re: time output... how to capture when running batch jobs?
-----------------------------------------------------------------

From: Walter Mecky <wal...@mecky.rent-a-guru.de>
Subject: Re: unbuffered stdout
Date: 10 Oct 92 13:24:46 GMT
To: info...@sem.brl.mil

In article <32...@adm.brl.mil> hus...@gdwest.gd.com (Sumner Hushing) writes:
< How does one go about suppressing buffering on stdout?
<
< We're redirecting stdout to a FIFO, which sends all output to a log file,
< so we can capture all messages for later review. Although messages to
< stdout which end with \n seem to be flushed, that's only true if stdout
< is the terminal. Once it's redirected to the FIFO, everything gets
< buffered. That messes up our time-tagging of the messages.

Correct. This is how stdio is supposed to work.

< We've tried a bunch of different system calls, ioctl specifications,
<
< fcntl
< ioctl

The abopve are real system calls and *cannot* affect the stdio
routines. To show this they are place in section 2 of the manual (e.m.
fcntl(2)).

< setbuf
< setvbuf
< setlinebuf

These ones are the right place and should affect the buffering. Because
of this they are placed in section 3 of the manual (e.m. setbuf(3)).
You should include fflush(3), which flushs the buffer.

< and nothing advertised seems to work.

You have to call the setbuf() routine before the first usage of the file
pointer. Did you? Then you should know that these routines can only
affect *your* program and not a program startet by exec(2) or system(3).

Hope that helps.

--
__o Walter Mecky
_ \<,_ wal...@rent-a-guru.de or ...uunet!unido!mikros!walter
(_)/ (_) Phone: +49 6152 40813

-----------------------------

From: Sophia Theophylactos <sthe...@condor.mcs.kent.edu>
Subject: Unix Talk
Date: 10 Oct 92 18:31:31 GMT
Sender: News Administrator <ne...@mcs.kent.edu>
Nntp-Posting-Host: mcs.kent.edu
To: info...@sem.brl.mil


Whenever I try to delete a character while in "talk," control-h's appear
on the screen. Is there a way for me to set my delete key so that it
ACTUALLY deletes characters while in "talk?" Is it something I should
put in my .login or .cshrc?

-S

-----------------------------

From: Ray Jones <ra...@celestial.com>
Subject: Re: IS UNIX DEAD?
Date: 10 Oct 92 19:01:25 GMT
To: info...@sem.brl.mil

In <1992Oct8.1...@maths.tcd.ie> ro...@maths.tcd.ie (Robert Bashford) writes:

>dans...@Autodesk.COM (Daniel Smith) writes:
>>act together. I'm going to slant my future learning efforts towards NT.

>> Daniel Smith, Autodesk, Sausalito, California, (415) 332-2344 x 2580

>pardon me for asking but WTF is NT?

Windows NT is Microsoft's next cure for all the world's ills.
From what I understand, it is UNIX made brain dead so that it is single
user. However they use the Mach kernel so they won't have to pay the
AT&T lic. fee.
--
Onager Systems Ray A. Jones
18710 NE 59th Ct. UUCP .....uunet!camco!onager!ray
# 2053 ...r...@onager.Celestial.COM
Redmond, WA 98052 206-885-3568

-----------------------------

From: crcha...@miavx1.acs.muohio.edu
Subject: Re: can a files protection be set...
Date: 10 Oct 92 20:00:47 GMT
To: info...@sem.brl.mil

In article <32...@adm.brl.mil>,


SCCS...@bureau.ucc.ie (David O'Byrne) writes:
> well the subject line says it all, I have an important document, that needs
> modifying, but I also want to protect it against inadvertent deletion...
>
> thanks
>

I believe that if you putyour filein a directory with permissions
744 (drwxr--r--), and set the file permissions to 766 (-rwxrw-rw-) you
would have what you wanted. So your final structure would look like
this...

$ ls -l <yourdirectory>

...
drwxr--r-- <foo>
...

$ cd foo

$ ls -l

...
-rwxrw-rw- <bar>
...


That should work. But then, I'm always open to flames.

> ....david


>
> ----------------------------------------
> David O'Byrne : sccs...@iruccvax.ucc.ie
> ----------------------------------------

Craig.

CRCHA...@MIAVX1.ACS.MUOHIO.EDU

-----------------------------

From: anna besprozannaya <be...@ellis.uchicago.edu>
Subject: winter 93 usenix info wanted
Date: 10 Oct 92 22:24:02 GMT
Sender: News System <ne...@wakinyan.uchicago.edu>
To: info...@sem.brl.mil

I've scanned newsgroups and FAQ's, and I can't find any announcements.
If you have any info, please mail it to me.

Thank you.

--------------------------------------------------------------------------------
Anna Pluzhnikov be...@ellis.uchicago.edu 312/955-5784

"Perfection is achieved, not when there is nothing left to add,
but when there is nothing left to take away" - Antoine de St. Exupery

-----------------------------

From: Peter Van Epp <van...@fraser.sfu.ca>
Subject: Re: 'w' command
Date: 11 Oct 92 19:11:55 GMT
Sender: ne...@sfu.ca
To: info...@sem.brl.mil

jal4...@uxa.cso.uiuc.edu (Smiley) writes:

>asri...@vela.acs.oakland.edu (MONK) writes:
>:)The 'w' or the what command seem to intrude the privacy, IS there any way
>:)to mask what the user is doing, to a foreign user executing the w command.
>:)The only way i thought so was by Starting a script, which creates a virtual
>:)shell.

>I usually run a few programs in the background, all of which spend about
>a minute sleeping each loop. A "w" on myself shows only that I'm sleeping.

>The problem is, "ps aux | grep <user>" will reveal all processes anyway.
>--
> Josh Laff # #
>email to: smi...@uiuc.edu _ _ Hello! I am a signature virus!
> (217) 384-6249 |#\_____/#| Join the fun and copy mo*#(*&^!>.
> \#######/

At least on the machines around here (i.e. SGI and Sun) so will a w -d
(which isn't documented) ...

Peter Van Epp / Operations and Technical Support
Simon Fraser University, Burnaby, B.C. Canada

-----------------------------

From: Cynthia Newton <new...@wilbur.psu.edu>
Subject: Re: 'w' command
Date: 11 Oct 92 21:37:02 GMT
Sender: Usenet <ne...@atlantis.psu.edu>
To: info...@sem.brl.mil

In article <vanepp.7...@sfu.ca> van...@fraser.sfu.ca (Peter Van Epp) writes:
>jal4...@uxa.cso.uiuc.edu (Smiley) writes:
>
>>asri...@vela.acs.oakland.edu (MONK) writes:
>>:)The 'w' or the what command seem to intrude the privacy, IS there any way
>>:)to mask what the user is doing, to a foreign user executing the w command.
>>:)The only way i thought so was by Starting a script, which creates a virtual
>>:)shell.
>
>>I usually run a few programs in the background, all of which spend about
>>a minute sleeping each loop. A "w" on myself shows only that I'm sleeping.
>
>>The problem is, "ps aux | grep <user>" will reveal all processes anyway.
>>--
>> Josh Laff # #
>>email to: smi...@uiuc.edu _ _ Hello! I am a signature virus!
>> (217) 384-6249 |#\_____/#| Join the fun and copy mo*#(*&^!>.
>> \#######/
>
>At least on the machines around here (i.e. SGI and Sun) so will a w -d
>(which isn't documented) ...
>
>Peter Van Epp / Operations and Technical Support
>Simon Fraser University, Burnaby, B.C. Canada

Try a soft link.....

-----------------------------

From: Tom Christiansen <tch...@convex.com>
Subject: Re: 'w' command
Date: 12 Oct 92 01:57:57 GMT
Sender: news access account <use...@neptune.convex.com>
Originator: tch...@pixel.convex.com
Nntp-Posting-Host: pixel.convex.com
X-Disclaimer: This message was written by a user at CONVEX Computer
Corp. The opinions expressed are those of the user and
not necessarily those of CONVEX.
To: info...@sem.brl.mil

From the keyboard of new...@wilbur.psu.edu (Cynthia Newton):
:Try a soft link.....

Nope, 'ps c' will find it.

This "hide from the next guy" stuff is weird. Why would you do that?

If you want a fascist system, you can do that by removing or limiting
all commands that check on other folks and then protect all kinds of
system files.

But why bother?

--tom
--
Tom Christiansen tch...@convex.com convex!tchrist


Yes, but every time I try to see things your way, I get a headache.

-----------------------------

From: Dave Schaumann <da...@cs.arizona.edu>
Subject: Re: 'w' command
Date: 12 Oct 92 06:52:12 GMT
Sender: ne...@organpipe.uug.arizona.edu
To: info...@sem.brl.mil

In article <1992Oct11.0...@vela.acs.oakland.edu>, asriniva@vela (MONK) writes:
>The 'w' or the what command seem to intrude the privacy,

So you think `w' "intrudes the privacy", huh? Ever try "ps -au"?

>IS there any way
>to mask what the user is doing, to a foreign user executing the w command.
>The only way i thought so was by Starting a script, which creates a virtual
>shell.

As you've already realized, it's fairly easy to hide from `w'. I
don't think there's any way to hide from "ps -au", though.

If you really want private computing resources, go get yourself a
single-user box for your desk.

--
You unlock this door with the key of imagination. Beyond it is another
dimension: a dimension of sound, a dimension of sight, a dimension of mind.
You're moving into a land of both shadow and substance, of things and ideas.
You've just crossed over into... the Twilight Zone.

-----------------------------

From: Jean-Pierre Radley <j...@jpradley.jpr.com>
Subject: Re: Which group is for SCO 3.2.4
Date: 11 Oct 92 19:20:05 GMT
To: info...@sem.brl.mil

In article <$dave...@sasb.byu.edu> $da...@sasb.byu.edu (Dave Edmunds - MIS Hardware) writes:
>I am having a rather obnoxious problem with an SCO Unix box, unfortunately I
>did not see a group that was specifically for SCO, except the Xenix and I
>don't think that is right.

Try biz.sco.general.
If your site doesn't get it, then get on the mailing list to which it is
mirrored:
Send this message to scogen-...@xenitec.on.ca
Add: da...@sasb.byu.edu
--
Jean-Pierre Radley Unix in NYC j...@jpr.com jpradley!jpr CIS: 72160,1341

-----------------------------

From: Bill Campbell <bi...@celestial.com>
Subject: Re: A QUESTION
Date: 11 Oct 92 20:44:50 GMT
To: info...@sem.brl.mil

In <1992Oct09.0...@trebor.uucp> ro...@trebor.uucp (Bob Stockler) writes:

:csc...@hertz.njit.edu (Sekhar Chitti) writes:

:>I have a question on using 'sed' and 'awk' to edit a text file.
:>I have a text file of nearly 500 lines and having 6 fields.
:>Now that I wanna delete the last 5 fields of each line and
:>keep only the first one. What is the easiest way I can do this?

:<infile awk '{ print $1 }' >outfile

Or: cut -f1 infile > outfile

Bill
--
INTERNET: bi...@Celestial.COM Bill Campbell; Celestial Software
UUCP: ...!thebes!camco!bill 6641 East Mercer Way
uunet!camco!bill Mercer Island, WA 98040; (206) 947-5591
SPEED COSTS MONEY -- HOW FAST DO YOU WANT TO GO?

-----------------------------

From: "Gary G. Gu" <g...@chpc.org>
Subject: bind() fails 2nd time prog run, how to fix it?
Date: 11 Oct 92 21:34:50 GMT
To: info...@sem.brl.mil

I hope this is the appropriate place to ask this question.

I'm writing elementry network programs using bsd sockets. My program uses
a client-server model. The server does a bind(), and accept()s a connection.
Everything runs ok the first time. The second time I run the program,
bind() fails. Socket was in use. I wait for a couple of minutes, the program
runs fine. I guess the OS is holding on to the sockets for a while and then
frees it.

How can I fix this problem? Can I free the socket before I exit the program?
Is there a UNIX command/program that allows me to examine the status with
regard to sockets?

Thank you for your help. If this is not the place for this question, please
tell me where I should post this.

-----------------------------

From: "Stephen P. Potter" <s...@crane.cis.ufl.edu>
Subject: Re: copying a file without login
Date: 11 Oct 92 21:46:17 GMT
Sender: Usenet Diskhog System <ne...@eng.ufl.edu>
To: info...@sem.brl.mil

In article <1992Oct11.0...@cam.compserv.utas.edu.au> mk...@esk.compserv.utas.edu.au (Michael C. KWAN) writes:
> Can I copy a file from another account (under same host) without using
>ftp, rlogin (rhosts) ? If I know the password of that account.
>
> Thanks in advance.
>
>
> Michael
Well, if the file protections are set correctly, you can simply copy it. Or, you
can use 'su' to become that user, copy it into another directory, 'chown' it to
you. Or, just change the file permissions after you 'su' and then copy it.

Of course, the obvious question is why are you so worried about copying it
without logging into the account, especially if you know the password (I'm
assuming you legally obtained the password)

Steve
Unix Consultant


--
cccc i ssss University of Florida Computer and Information Sciences
c s Unix Consulting Staff (904) 392-1183 E309A
c i ssss Email: s...@ufl.edu, s...@cis.ufl.edu,
c i s u493...@elm.circa.ufl.edu, PRIS...@MAPLE.circa.ufl.edu cccc i ssss PRIS...@ufcc.ufl.edu, Bitnet: PRISONER@ufcc

-----------------------------

From: Russell Mosemann <mose...@unlinfo.unl.edu>
Subject: tset when term=vt300? (rephrased repost)
Keywords: tset unknown default vt100
Date: 11 Oct 92 23:12:04 GMT
Sender: ne...@unlinfo.unl.edu
Nntp-Posting-Host: unlinfo.unl.edu
To: info...@sem.brl.mil


I think I was misleading about what I was looking for in my original
post, so I will try to explain it better in this repost. All of the
connections made to our Sun SPARC 2 will be through the network, except
for the console. I would like tset to quietly go about its business and
set the terminals when they are something like a sun, vt100, vt200,
xterms, hp19, etc. That part works fine.
However, when the type is not known (i.e. not in termcap/info), I'd
like tset to offer to set the terminal to a vt100 for the user, not to
unknown.
A thought that just came to me that might work is to let tset go
ahead and ask its question. If the user just pressed <return>, the
terminal type would be unknown and then I could set it to vt100. How
about something like this?

set noglob
eval `tset -sQ`
set glob
set noglob
eval `tset -sQ -m 'unknown:vt100'`
set glob

--
Russell
mose...@unl.edu

-----------------------------

From: Leif Jensen <lhje...@fish.princeton.edu>
Subject: Re: tset when term=vt300? (rephrased repost)
Keywords: tset unknown default vt100 noglob
Date: 12 Oct 92 03:42:08 GMT
Sender: USENET News System <ne...@princeton.edu>
Originator: news@nimaster
Nntp-Posting-Host: fish.princeton.edu
To: info...@sem.brl.mil

In article <1992Oct11....@unlinfo.unl.edu> mose...@unl.edu writes:
>set noglob
>eval `tset -sQ`
>set glob

This has come up before. In csh, the statement "set noglob" actually
creates a shell variable named "noglob". Before the shell expands *
and ?, etc., it checks whether "noglob" is in the variable table. If
it is then it leaves * and company alone, otherwise it performs
globbing as usual. Therefore the command that undoes "set noglob" is
"unset noglob", which removes the variable "noglob" from the shell's
table. The command "set glob" will create a new variable named "glob",
which has absolutly no effect on anything relevant, including
globbing. If you put the quoted lines in your .login, you will be
frustrated when things like "ls *.c" fail to work as expected.

Presumably our experiences with English and certain vi conventions make
this difficult to remember, but it is not really very tricky.

--
Leif Jensen
lhje...@phoenix.princeton.edu

-----------------------------

From: "C. S. Chang" <csc...@hamlet.umd.edu>
Subject: UnixWare from Univel
Date: 12 Oct 92 02:03:51 GMT
Sender: ne...@umd5.umd.edu
To: info...@sem.brl.mil


Please provide me some information on UnixWare from Univel. Such as
how it work, it's requirement and how to get a beta testing system.

Thanks in advance.

-----------------------------

From: kbor...@vangogh.helios.nd.edu
Subject: /dev/audio permissions
Date: 12 Oct 92 02:31:08 GMT
Sender: USENET News System <ne...@news.nd.edu>
To: info...@sem.brl.mil

This post is concerning the problem of turning off the audio device to outside
use.

Someone posted his answer which consisted of adding a line to the file
/etc/fbtab that would allow only the person logged on console the permissions
to use the /dev/audio device.

I tried using this approach while running version 4.2 but could not get it to
work.

It came up with the error Permission Denied -- evidently it gave permission to
no one...not even the user on console.

Has anyone else encountered the same problems, or does anyone recognize what
might be the problem?

Thanks.

Keith Bornhorst ( kbor...@bach.helios.nd.edu )

-----------------------------

From: Dave Ritchie <d...@hpuerca.atl.hp.com>
Subject: Re: What does 'daemon' mean?
Date: 12 Oct 92 02:59:01 GMT
To: info...@sem.brl.mil


From the dictionary, 'daemon' is an intermediary between God and man.
The monitor being 'God' in this case.

-- Dave Ritchie
d...@hpuerca.atl.hp.com

-----------------------------

From: Paul Richards <spe...@thor.cf.ac.uk>
Subject: Removing inodes?
Date: 12 Oct 92 04:12:07 GMT
Sender: Network News System <ne...@cm.cf.ac.uk>
X-Mailer: Cardiff Computing Maths PP Mail Open News Gateway
To: info...@sem.brl.mil

I've got a corrupted directory entry in lost+found that I can't get rid
of. Using fsck doesn't work, it goes through the motions of fixing the
filesystem but when I reboot fsck aborts and requests that I run it
manually. This always detects the same corrupted directory entry.

Is there some way of deleting this file by fixing the inode that fsck
isn't capable of?
--
Paul Richards at Cardiff university, UK.

spe...@uk.ac.cf.thor Internet: spedpr%thor.c...@nsfnet-relay.ac.uk
UUCP: spe...@cf-thor.UUCP or ...!uunet!mcsun!uknet!cf!thor!spedpr
+++

-----------------------------

From: Nasir Ahmed Noor <umn...@ccu.umanitoba.ca>
Subject: Any Good Book(s) about [Advance] "C" on Unix ?
Date: 12 Oct 92 07:05:23 GMT
Sender: ne...@ccu.umanitoba.ca
Nntp-Posting-Host: ccu.umanitoba.ca
To: info...@sem.brl.mil


Could someone please list a [few] good book[s] which discuss C programming
IN DEPTH on Unix system. I have just recently started to experiment with
C, but I am otherwise quite comfortable with programming. All introductory
or 'make yourself master' books on C really start from telling me what a
computer and a byte is. Result is that about half of the book is of no use
and in this process I just cant learn. Also none of the books tell me the
advanced level C stuff and interfacing with operating system [Unix]
etc etc. What is your pick for a book in this "range"?

thanks.

--nasir
umn...@ccu.umanitoba.ca

-----------------------------

From: Samuel Ko <k...@fraser.sfu.ca>
Subject: Re: Any Good Book(s) about [Advance] "C" on Unix ?
Date: 12 Oct 92 07:35:53 GMT
Sender: ne...@sfu.ca
To: info...@sem.brl.mil

umn...@ccu.umanitoba.ca (Nasir Ahmed Noor) writes:

>Could someone please list a [few] good book[s] which discuss C programming
>IN DEPTH on Unix system. I have just recently started to experiment with
>C, but I am otherwise quite comfortable with programming. All introductory
>or 'make yourself master' books on C really start from telling me what a
>computer and a byte is. Result is that about half of the book is of no use
>and in this process I just cant learn. Also none of the books tell me the
>advanced level C stuff and interfacing with operating system [Unix]
>etc etc. What is your pick for a book in this "range"?

>thanks.

Some suggestions from my list of recommended Unix books ...

2. Title: Advanced Programming in The Unix Environment
Author: Richard Stevens
Publisher: Addison-Wesley
Edition: 1992
ISBN: 0-201-56317-7
Comment: **** Highly Recommended ****
A going-to-be classic on how programs work under Unix ...

3. Title: Advanced Unix Programming
Author: Marc Rochkind
Publisher: Prentice Hall
Edition: 1985
ISBN: 0-13-011818-4
Comment: A superb book covering all system calls in detail ...

4. Title: The C Programming Language
Authors: Brian Kernighan and Dennis Ritchie
Publisher: Prentice Hall
Edition: 2nd ed. 1988
ISBN: 0-13-110362-8
Comment: This book is 200% a MUST for any C programmers ...

5. Title: C - A Reference Manual
Authors: Samuel Harbison and Guy Steel
Publisher: Prentice Hall
Edition: 3rd ed. 1991
ISBN: 0-13-110933-2
Comment: An authoritative reference to C programming language ...
A good companion to Kernighan and Ritchie ...

7. Title: Practical C Programming
Author: Steve Oualline
Publisher: O'Reilly
Edition: 1991
ISBN: 0-937175-65-X
Comment: Yet another good book on C ...

8. Title: Using C on the Unix System
Author: David Curry
Publisher: O'Reilly
Edition: 1990
ISBN: 0-937175-23-4
Comment: This book is directed to (would-be) system programmers ...

9. Title: The Berkeley Unix Environment
Author: Nigel Horspool
Publisher: Prentice Hall
Edition: 2nd ed. 1992
ISBN: 0-13-089368-4
Comment: An excellent book on C programming for Berkeley Unix system ...

10. Title: The Waite Group's C++ Programming
Author: John Berry
Publisher: Sams
Edition: 1992
ISBN: 0-672-22771-1
Comment: A fine book on C++ (for Unix and Dos) ...

11. Title: Managing Projects with make
Authors: Steve Talbott and Andrew Oram
Publisher: O'Reilly
Edition: 2nd ed. 1991
ISBN: 0-937175-90-0
Comment: An unique text on using make and handling Makefile ...


--
S a m u e l
Quasi-expert on computer books/documentations ...
Quasi-expert on PC sharewares/freewares ...
Quasi-expert on everything ... :)

-----------------------------

From: Josef Moellers <molle...@sni.de>
Subject: Re: Sockets and stuff
Date: 12 Oct 92 07:42:00 GMT
Sender: Moellers <jo...@nixpbe.sni.de>
To: info...@sem.brl.mil

In <Bvu2C...@cs.dal.ca> dig...@ug.cs.dal.ca (Mike Digdon) writes:


>I am working on a project that involves a daemon, and obviously, I will be
>using sockets for all of the communications. After looking thru various FAQ's
>and stuff, I just can't seem to find what I am looking for..

>I know how to set up a socket and talk with it.. however, my problem is
>waiting for a connection and multiple users..

>If a connection has not been made, I want my program (the daemon) to run
>some other stuff, since more than one user will be able to access it at
>a time. I am led to believe that accept sits and waits for a connection
>of some sort and doesn't do anything else until a connection is made.
>Am I incorrect in this assumption? If this is the case, how would I check
>to see if a connection is being made, and if not, continue running other
>parts of my program to take care of the users who are already connected.

>And where might I find some stuff on the net that talks about sockets and
>daemons and the like? I have a few books here, but they don't say much..
>at least not what I need..

Then You haven't read Stevens' book. It gives very fine examples for
concurrent servers that do just what You want.
You'll have a "daemon" that sits and waits for connections and, if one
arrives, forks off a child to do the dirty work while daddy sits ... and
waits for connections.
--
| Josef Moellers | c/o Siemens Nixdorf Informationssysteme AG |
| USA: molle...@sni-usa.com | Abt. STO-XS 113 | Riemekestrasse |
| !USA: molle...@sni.de | Phone: (+49) 5251 835124 | D-4790 Paderborn |

-----------------------------

From: Josef Moellers <molle...@sni.de>
Subject: Re: What does cc -D option means ?
Date: 12 Oct 92 07:43:57 GMT
Sender: Moellers <jo...@nixpbe.sni.de>
To: info...@sem.brl.mil

In <32...@adm.brl.mil> AMA...@fncrd0.fnal.gov (Jorge Luis M. do Amaral) writes:

>Hi ,
> Does anyone can explain me what the cc -D option means ?

> I'm trying to compile a program that has in his make something
>like:
> cc -g -DWANT_X11 -DWANT_MFB ....

It's the command line equivalent of

# define WANT_X11 1
# define WANT_MFB 1

There is another version of -D that allows You to replace the "1":

cc -g -DDATE=\"10/12/92\" ...

which is the equivalent of

# define DATE "10/12/92"

But You're not trying to tell us that "man cc" doesn't tell You all
this, do You?
--
| Josef Moellers | c/o Siemens Nixdorf Informationssysteme AG |
| USA: molle...@sni-usa.com | Abt. STO-XS 113 | Riemekestrasse |
| !USA: molle...@sni.de | Phone: (+49) 5251 835124 | D-4790 Paderborn |

-----------------------------

From: Richard Czech <ric...@borneo.gmd.de>
Subject: Re: time output... how to capture when running batch jobs?
Date: 12 Oct 92 13:09:23 GMT
Sender: USENET News <ne...@gmd.de>
Nntp-Posting-Host: hawaii
To: info...@sem.brl.mil

In article <BvvC4...@usenet.ucs.indiana.edu>, Eric C. Garrison
<er...@sopwith.ucs.indiana.edu> writes:
|> The thing is, I am not sure how to redirect the output of
|> time to another file. Even redirecting the stderr to
|> a file produces no output.

Try this in Bourne Shell:

time myprog 2> time.out

Time writes it's output to stderr.

----------------------------------------------------------------------
Richard Czech e-mail: cz...@gmd.de
GMD-I5-FIT
P.O.Box 13 16 phone: (+49) 2241 14 2039
D-5205 St. Augustin 1, Germany fax: (+49) 2241 14 2342
----------------------------------------------------------------------

-----------------------------


End of INFO-UNIX Digest
***********************

REGI's

unread,
Oct 15, 1992, 9:44:53 AM10/15/92
to
>X-Envelope-to: info-unix%brl.mil%csbrmu1...@aearn.edvz.uni-linz.ac.at
>X-VMS-To: IN::"info-unix%brl.mil%csbrmu1...@aearn.edvz.uni-linz.ac.at"

1
15-OCT-1992 16:26:15.66
1 00:00:00.00
16-OCT-1992 16:26:15.66
info-uni...@sem.brl.mil
raf...@obelix.cica.es

Received: from SEM.BRL.MIL by ESEVVX.CICA.ES ; 12-OCT-1992 16:26:10.53
Received: from SEM.BRL.MIL by SEM.BRL.MIL id aa14742; 12 Oct 92 9:41 EDT
Received: from wharf.brl.mil by SEM.BRL.MIL id aa14731; 12 Oct 92 9:32 EDT
Received: from aearn.edvz.uni-linz.ac.at by WHARF.BRL.MIL id aa10357;
12 Oct 92 9:18 EDT
Received: from CSBRMU11.BITNET by AEARN.EDVZ.Uni-Linz.AC.AT (IBM VM SMTP V2R2)
with BSMTP id 7800; Mon, 12 Oct 92 14:18:55 CET
Received: from CSBRMU11 by CSBRMU11.BITNET (Mailer R2.07) with BSMTP id 9421;
Mon, 12 Oct 92 14:19:50 MET
Received: from arwen.ics.muni.cs (GATEWAY) by CSBRMU11.BITNET (Mailer R2.07)
with BSMTP id 9420; Mon, 12 Oct 92 14:19:50 MET
Received: from hp807.ovc.vutbr.cs by arwen.ics.muni.cs
(5.59/UW-NDC Revision: 2.21 ) id AA05513; Mon, 12 Oct 92 14:19:07 CET
Received: by hp807.ovc.vutbr.cs (16.6/2.0)
id AA10193; Mon, 12 Oct 92 14:19:21 +0100
From: Jeff Bowyer
<jbowyer%ovc.vutbr.cs%CSBRMU1...@aearn.edvz.uni-linz.ac.at>
Message-Id: <921012131...@hp807.ovc.vutbr.cs>
Subject: getty command
To: Listserv for UNIX questions
<info-unix%brl.mil%csbrmu1...@aearn.edvz.uni-linz.ac.at>
Date: Mon, 12 Oct 92 14:19:19 MET
Reply-To: jbowyer%ovc.vutbr.cs%CSBRMU1...@aearn.edvz.uni-linz.ac.at
Mailer: Elm [revision: 66.25]

Where can I get source code for the getty command?

Thank you for your assistance.

==========================================================================
Jeff Bowyer EMail:
Technical University of Brno jbowyer%ovc.vu...@csbrmu11.bitnet
Udolni 19, 602 00 BRNO
Czechoslovakia
==========================================================================

REGI's

unread,
Oct 15, 1992, 10:59:58 AM10/15/92
to
>X-Envelope-to: INFO...@BRL.mil
>X-VMS-To: IN::"INFO...@BRL.MIL"

1
15-OCT-1992 00:29:33.03
1 00:00:00.00
16-OCT-1992 00:29:33.03
info-uni...@sem.brl.mil
raf...@obelix.cica.es

Received: from SEM.BRL.MIL by ESEVVX.CICA.ES ; 12-OCT-1992 00:28:52.03
Received: from SEM.BRL.MIL by SEM.BRL.MIL id ab10361; 11 Oct 92 17:31 EDT
Received: from sem.brl.mil by SEM.BRL.MIL id aa10035; 11 Oct 92 15:15 EDT
Date: Sun, 11 Oct 92 15:15:47 EST


From: The Moderator (Mike Muuss) <Info-Uni...@BRL.MIL>
To: INFO...@BRL.MIL
Reply-To: INFO...@BRL.MIL

Subject: INFO-UNIX Digest V16#035
Message-ID: <921011151...@SEM.BRL.MIL>

INFO-UNIX Digest Sun, 11 Oct 1992 V16#035

Today's Topics:
File Distribution Package
Re: MIT X11R5 problem with SUID & SGID
Re: Porting under UNIX (Was: Re: NT Under SCO Unix)
Re: A QUESTION
Zmodem & cu
BUG IN BOURNE SHELL AND/OR CSHELL ??
Re: BUG IN BOURNE SHELL AND/OR CSHELL ??
Porting the lpd suite
Re: Shell question
PC/NFS vs Netware
Re: Profiling on shared library..
Re: Anyone can remove files


time output... how to capture when running batch jobs?
Re: time output... how to capture when running batch jobs?

Re: Imakefile???
exec-ing script after kill -TERM 1?
Help with fork() and exec__()
Re: Help with fork() and exec__()
Q: 'Man'ning personal man pages
Re: Q: 'Man'ning personal man pages
Re: IS UNIX DEAD?
Re: prtvtoc (SVR4) vs. dkinfo (SUN OS 4.1.1)
talk messages
tset when term=vt300 (a.k.a. offering a choice)
Re: tset when term=vt300 (a.k.a. offering a choice)


copying a file without login

How to delete trailing blanks from data?
Re: 'w' command
savehist and .history
-----------------------------------------------------------------

From: "Robert K. Hendershot" <rhen...@areyes.com>
Subject: File Distribution Package
Date: 6 Oct 92 12:53:24 GMT
To: info...@sem.brl.mil

I need help locating a productized package for
file distribution from a UNIX-SVR4 platform.

Similar products on UNIX are Tuxedo at
AT&T, and some others, but these are
much more than is needed to distribute
files and programs from UNIX. A similar
product in the PC-world is Xcellenet.
Does Xcellenet run on any UNIX systems
in the server mode?

Thanks in advance.

[oO]
/{}\
^^

-----------------------------

From: kelly <ke...@nmt.edu>
Subject: Re: MIT X11R5 problem with SUID & SGID
Date: 6 Oct 92 20:08:39 GMT
To: info...@sem.brl.mil

In article <35...@cbmvax.commodore.com> ve...@cbmvax.commodore.com
(Jeff Veiss - Staff) writes:

>Please reply via E-mail and I'll post the results.

I've decided to post since this seems to be a problem that many users
are experiencing---and it's something wrong in the install script.
I've also trimmed the crossposting.

> [Problems running xterm and other setuid/setgid X programs]

First, read the manpage for ld.so. Hidden deep in ENVIRONMENT section
it says that `when running a set-user- or set-group-ID program, ld.so
will only search for libraries in directories it "trusts", which are
/usr/lib, /usr/5lib, /usr/local/lib, and any directories specified
within the executable as a result of -L options given when the
executable was constructed.'

So any permutation of your LD_LIBRARY_PATH won't help. You've got to
make sure the X libraries are installed in the `trusted' directories
or make sure each X client is linked that the -L options that will
actually contain the libraries once you've done the make install.

My next beef has to do with the `install' target and SUN-DES-1
authorization. The mit `install' target installs xterm as set-uid
root, so it can update the /etc/utmp file.

However, a program that runs set-uid root uses root's key on the local
machine rather your key, rendering SUN-DES-1 authorization only useful
for useless clients like xclock, xman, ... . You can't run xterms.

The fix: install xterm as set-gid tty, not set-uid root, and make sure
/etc/utmp is group-writable by group tty. Then, an xterm runs with
your user ID, so it uses your key for SUN-DES-1, and you've got the
protection you were after.

Apparently, the X Consortium didn't test this before X11R5 was
released. It needs to be fixed.

--k

-----------------------------

From: Anthony P Lawrence <a...@world.std.com>
Subject: Re: Porting under UNIX (Was: Re: NT Under SCO Unix)
Date: 7 Oct 92 00:27:18 GMT
To: info...@sem.brl.mil

In article <KETIL.92O...@ugle.ii.uib.no> ke...@ii.uib.no writes:
>
>Well, maybe it's difficult to write portable code under Unix, I
>haven't really tried, but I have ported (compiled) quite a few
>applications to our systems. And I find that there usually is very
>little difficulty involved.
>
>
>Sure, UNIX versions varies, but remember that if Unix had been
>produced by *one* vendor from the start, it wouldn't have become what
>it is today.

In this week's InfoWorld, Cringely reports Bill Gates as saying "NT
is essentially Unix".

Is that a mistake? If a corporation knew they had to move from
Dos, considered Unix but decided to wait for NT thinks about it,
why wait?

On the one side you have One Vendor not quite yet producing something
that may be pretty unstable for a few years.

On the other side you have... well, we all know what we have.

Hearing Bill say that, might not the decision be "why not go with
Unix now?"

Tony

Lawrence & Clark, Inc (617) 762-0707 (206) 323-2864
Xenix/Unix support,etc Boston Seattle

-----------------------------

From: Bob Stockler <ro...@trebor.uucp>
Subject: Re: A QUESTION
Date: 9 Oct 92 00:45:00 GMT
To: info...@sem.brl.mil

csc...@hertz.njit.edu (Sekhar Chitti) writes:

>I have a question on using 'sed' and 'awk' to edit a text file.
>I have a text file of nearly 500 lines and having 6 fields.
>Now that I wanna delete the last 5 fields of each line and
>keep only the first one. What is the easiest way I can do this?

<infile awk '{ print $1 }' >outfile

-----------------------------

From: Hemant Shah <sh...@fnsony.fnal.gov>
Subject: Re: A QUESTION

Date: 9 Oct 92 20:18:06 GMT
NNTP-Posting-Host: fnsony.fnal.gov
To: info...@sem.brl.mil

In article <1992Oct7.2...@njitgw.njit.edu>, csc...@hertz.njit.edu (Sekhar Chitti) writes:
|>
|>
|>
|>
|> Hi netters,


|>
|> I have a question on using 'sed' and 'awk' to edit a text file.
|> I have a text file of nearly 500 lines and having 6 fields.
|> Now that I wanna delete the last 5 fields of each line and
|> keep only the first one. What is the easiest way I can do this?

|> I am a bit familiar with sed and awk. But don't know exactly
|> how I can use them to do this? Could anybody help me in this
|> regard? Thanks.
|>
|> Sekhar
|> csc...@hertz.njit.edu
|>
|> --
|> Sekhar P Chitti
|> 381 Broad Street, Apartment #2109-A,
|> Newark, NJ - 07104
|> Phone # 201-482-2801 (res)

Assumimg that each field is seperated by blank space(s) of tab(s), use following
shell script:

---------------- 8< ------ begin script -------------- 8< -----------------
:


cat oldfile | awk '{
printf("%s\n",$1)
}' > newfile

---------------- 8< ------ end script -------------- 8< -------------------

substitute the names of oldfile and new files.

-------------------------------------------------------------------------------
Hemant Shah | All the opinions expressed are my own
Fermi National Accelerator Laboratory | and does not necessarily reflect
Systems Integration Group | those of Fermilab.
E-mail :sh...@fnal.fnal.gov |
Voice : (708) 840-8071 | I haven't lost my mind
Fax : (708) 840-2783 | it's backed on tape somewhere.
-------------------------------------------------------------------------------

-----------------------------

From: Ian Moran <ia...@icsbelf.co.uk>
Subject: Zmodem & cu
Keywords: zmodem, cu
Date: 9 Oct 92 09:18:32 GMT
X-Newsreader: TIN [version 1.1 PL6]
To: info...@sem.brl.mil

Hello

How can the file transfer protocol, zmodem, be used sucessfully over
a cu link to another host machine. I have tried cu'ing to the host
machine and starting a file tranfer from host to local. Starting a local
shell and then running the zmodem in receive mode doesn't work. Th transfer
eventually times out.

Regards

Ian

--

Ian Moran Internet: ia...@icsbelf.co.uk
ICS Computing Group Ltd. UUCP: ...{uknet,uunet,mcsun}!icsbelf!ianm
Belfast, N. Ireland. Fidonet: 2:440/59.5, 2:257/10.1, 2:252/309.6

-----------------------------

From: "C. Gareth Gaston" <ga...@quads.uchicago.edu>
Subject: BUG IN BOURNE SHELL AND/OR CSHELL ??
Date: 9 Oct 92 12:12:07 GMT
Sender: News System <ne...@wakinyan.uchicago.edu>
To: info...@sem.brl.mil

I have a large Bourne Shell script that need to pick up the values
of some variables set in a C-Shell script. The values are set
with setenv and I'd like to "soucre" the file that sets all the
values right before running a binary. In doing this I came upon
what looks like a bug in either sh or csh. The following script
demonstrates the problem. Is it a bug or am I mis-understanding
something?

<<<<<<<<<<< CUT HERE CUT HERE CUT HERE >>>>>>>>>>>>>>>>>>>>>
#!/bin/sh

export VAR
VAR=BOURNESHELL

echo Running Bourne Shell: VAR is $VAR

csh -f << exit
setenv VAR CSHELL
printenv VAR # This will print "CSHELL"
echo Running C-Shell: VAR is $VAR # But this prints "BOURNESHELL" ?!
exit
<<<<<<<<<<< CUT HERE CUT HERE CUT HERE >>>>>>>>>>>>>>>>>>>>>


Any help would be much appreciated.

Thanks,

Gareth Gaston
--
C. Gareth Gaston
University of Chicago
ga...@midway.uchicago.edu

-----------------------------

From: Chet Ramey <ch...@odin.ins.cwru.edu>
Subject: Re: BUG IN BOURNE SHELL AND/OR CSHELL ??
Date: 9 Oct 92 14:15:13 GMT
NNTP-Posting-Host: odin.ins.cwru.edu
To: info...@sem.brl.mil

In article <1992Oct9.1...@midway.uchicago.edu> ga...@midway.uchicago.edu writes:

>export VAR
>VAR=BOURNESHELL
>
>echo Running Bourne Shell: VAR is $VAR
>
>csh -f << exit
> setenv VAR CSHELL
> printenv VAR # This will print "CSHELL"
> echo Running C-Shell: VAR is $VAR # But this prints "BOURNESHELL" ?!
>exit

Unless the word delimiting the here document is quoted, the Bourne
shell performs variable expansion and command substitution on each
line before sending it to the program (csh in this case). sh is
expanding $VAR to `BOURNESHELL' before csh even sees the line. The
output of printenv shows that csh has its own value for the variable.

Chet
--
``The use of history as therapy means the corruption of history as history.''
-- Arthur Schlesinger

Chet Ramey, Case Western Reserve University Internet: ch...@po.CWRU.Edu

-----------------------------

From: Peter Steele <pe...@merlin.acadiau.ca>
Subject: Porting the lpd suite
Date: 9 Oct 92 14:30:50 GMT
Sender: ne...@dragon.acadiau.ca
Nntp-Posting-Host: merlin
To: info...@sem.brl.mil

I need to make local modifications to the lpd suite to support
forms codes. This should be realtively straightforward, assuming
I can find some portable source code for the lpd suite of programs.
I tried fetching the BSD lpd sources but there seems to be a lot
of stuff associated with the programs. For example, I managed to
get one of the programs to compile but it doesn't link, complaining
about various undefined library routines, and I cannot find these
routines in header files or libraries. Has any tried porting lpd
to another system?
--
Peter Steele Unix Services Manager peter....@acadiau.ca
Acadia Univ., Wolfville, NS, Canada B0P 1X0 902-542-2201 Fax: 902-542-4364

-----------------------------

From: Rich Lenihan <ri...@progress.com>
Subject: Re: Shell question
Keywords: ksh, csh et all.
Date: 9 Oct 92 14:58:11 GMT
Sender: "Mr. Usenet" <use...@progress.com>
Nntp-Posting-Host: bikini
To: info...@sem.brl.mil

wa...@jahangir.UUCP (wayne) writes:


> Is there a way to test a shell variable to tell if it's
>an integer or a string?

[ `expr $VAR + 0 2>/dev/null` ] && echo INTEGER || echo NOT!

-Rich

--
Rich Lenihan UUCP: mit-eddie!progress!rich
Progress Software Corp. Internet: ri...@progress.com

-----------------------------

From: ANDY KUMEDA <kum...@beach.csulb.edu>
Subject: PC/NFS vs Netware
Date: 9 Oct 92 15:22:26 GMT
To: info...@sem.brl.mil

Sorry if this topic has been brought up before...

The question: Should we use Sun's PC/NFS or Novell's Netware?!?
I mainly would like a summary of Pros and Cons between the two.

Things that should be considered:
1) Hardware requirements. (Note: we already have an Ethernet network
established.)
a. Server cost/type
2) Software requirments.
a. Server software cost
b. Client software cost
3) Advantages vs Disadvantages between the two
a. Will the end-user notice any difference?!?
b. Which is easier to administer?!?
c. Print capabilities?!?
d. Misc. (ie other important issues)

If it's of any significance, our site consists of several hundred
PC's (286's, 386/25, 386/33) all connected by UTP Ethernet.

Please e-mail responses as I do not read all the newsgroups that I
posted to -- I will summarize later.

Thank you.

Andy Kumeda
US Naval Weapons Station, Seal Beach
(310) 594-7114
kum...@hawk.nwac.sea06.navy.mil
kum...@csulb.edu

-----------------------------

From: Barry Margolin <bar...@think.com>
Subject: Re: Profiling on shared library..
Date: 9 Oct 92 16:41:52 GMT
NNTP-Posting-Host: telecaster.think.com
To: info...@sem.brl.mil

In article <1992Oct8.2...@mdd.comm.mot.com> pc...@mdd.comm.mot.com (Pat Chan) writes:
>I'm trying to do profiling (Sun profile) on my program.
>The ld chokes when it's a shared library.

Sun doesn't ship shared versions of the profiling libraries; i.e. there are
no /usr/lib/lib*_p.so.* files, only lib*_p.a. Use -Bstatic when linking
for profiling.
--
Barry Margolin
System Manager, Thinking Machines Corp.

bar...@think.com {uunet,harvard}!think!barmar

-----------------------------

From: Tim Thompson <t...@blink.att.com>
Subject: Re: Profiling on shared library..
Date: 9 Oct 92 18:34:22 GMT
Sender: NetNews Administrator <ne...@cbnewsh.cb.att.com>
Nntp-Posting-Host: sparc-10.ho.att.com
To: info...@sem.brl.mil

bar...@think.com (Barry Margolin) writes:

>In article <1992Oct8.2...@mdd.comm.mot.com> pc...@mdd.comm.mot.com (Pat Chan) writes:
>>I'm trying to do profiling (Sun profile) on my program.
>>The ld chokes when it's a shared library.

>Sun doesn't ship shared versions of the profiling libraries; i.e. there are
>no /usr/lib/lib*_p.so.* files, only lib*_p.a. Use -Bstatic when linking
>for profiling.

Can you use -Bstatic when compiling a program that uses -ldl ? I wanted to
do that just last week, and couldn't figure out how to (because
there's only /usr/lib/libdl.so, with no .a equivalent). I had to hack
together a version of my program that didn't use dlopen(), etc., but that
seems unfortunate. Is there a libdl.a somewhere? Or are dynamic loading
and profiling fundamentally incompatible in some way?

...Tim Thompson...AT&T Bell Labs/Holmdel/NJ...tjt@blink.att.com...

-----------------------------

From: Barry Margolin <bar...@think.com>
Subject: Re: Profiling on shared library..
Date: 9 Oct 92 21:00:58 GMT
NNTP-Posting-Host: telecaster.think.com
To: info...@sem.brl.mil

In article <tjt.718655662@sparc-10> t...@blink.att.com (Tim Thompson) writes:
>Can you use -Bstatic when compiling a program that uses -ldl ?

No. libdl.so.* is actually a dummy routine, and the dlopen(), et al,
routines are actually in ld.so, which is only linked into
dynamically-linked executables.

However, it's possible to have a mixture of dynamic and static linking in a
program, so you may be able to do this by only linking libdl dynamically.
--
Barry Margolin
System Manager, Thinking Machines Corp.

bar...@think.com {uunet,harvard}!think!barmar

-----------------------------

From: Barry Margolin <bar...@think.com>
Subject: Re: Anyone can remove files
Date: 9 Oct 92 16:56:00 GMT
NNTP-Posting-Host: telecaster.think.com
To: info...@sem.brl.mil

In article <1992Oct9.0...@uts.cc.wayne.edu> t...@uts.cc.wayne.edu (Thomas Richard Stevenson) writes:
>col...@bldrdoc.gov (Sean Coleman 497-5672 ) writes:
>>If a directory has the permissions drwxrwxrwx and there
>>exists a file in the directory owned by user A with
>>permissions rw-------, why should anyone be allowed to
>>remove the file?

>There are two different permissions here. The file permissions
>control what a user can do with the data within the file. It
>does NOT control what a user can do with the file it's self.
>
>The dir permissions control what a user can do with the file. It
>does NOT control what a user can do with the data within the file.

Actually, that explanation isn't quite right.

A directory only contains file names and references to the actual files.
Directory permissions control what you can do with the names of files.
This includes removing the name of a file.

An analogy would be a library with a card catalog and a rare books
collection. The rare books may be in a locked room, but the catalog would
be accessible to users. Anyone can steal the a card out of the catalog,
but only the librarian can get a book from this room. (The flaw in this
analogy is that stealing the card doesn't make the book disappear, but
removing the last link to a Unix file makes it go away.)

The difference between this and what Thomas said is that the file
permissions also govern the ability to change modes, set the mtime and
atime, and change ownership (on versions of Unix that permit ordinary users
to do this). These are operations on the file, not its contents, but they
are still controlled by the file permissions.
--
Barry Margolin
System Manager, Thinking Machines Corp.

bar...@think.com {uunet,harvard}!think!barmar

-----------------------------

From: "Eric C. Garrison" <er...@sopwith.ucs.indiana.edu>
Subject: time output... how to capture when running batch jobs?
Date: 9 Oct 92 19:12:54 GMT
Sender: er...@sopwith.ucs.indiana.edu
MMDF-Warning: Parse error in original version of preceding line at BRL.MIL
Content-Type: text
Content-Length: 529
To: info...@sem.brl.mil

I had a question posed to me that I couldn't answer regarding
the time program. The guy wants to run a very long job on
a Sun workstation and also wants to see how much CPU time
it takes at the end of the job. He's running a program
written in FORTRAN, if it matters.

The thing is, I am not sure how to redirect the output of
time to another file. Even redirecting the stderr to
a file produces no output.

Any ideas?

Eric

--
Eric Chris Garrison UCS Support Center
er...@ucs.indiana.edu Indiana University

-----------------------------

From: "Christian P. Roberts" <cp...@holmes.acc.virginia.edu>
Subject: Re: time output... how to capture when running batch jobs?

Date: 9 Oct 92 20:25:55 GMT
Sender: use...@murdoch.acc.virginia.edu
To: info...@sem.brl.mil

Use etime (elapsed time) or dtime (elapsed time since last call
to dtime) within the Fortran code and just write it to a file
or stdout, as in:

program time
real t(2)
real t1,t2

t1=dtime(t)
... do some work
t2=dtime(t)
write(*,1000)t1
write(*,2000)t2
write(*,3000)t2
write(*,4000)t(1)
write(*,5000)t(2)
1000 format(' Start timer, t1= ',G14.6)
2000 format(' Second call to timer, t2= ',G14.6)
3000 format(' Elapsed time between calls is t2: ',G14.6)
4000 format(' User time is t(1): ',G14.6)
5000 format(' System time is t(2): ',G14.6)
end

--

Chris Roberts Academic Computing Center
cp...@virginia.edu University of Virginia
(804) 982-4693 Charlottesville, Virginia 22903

-----------------------------

From: Eduardo Rodriguez <erod...@dcc.uchile.cl>
Subject: Re: Imakefile???
Date: 9 Oct 92 20:38:23 GMT
Sender: Network News <use...@dcc.uchile.cl>
Originator: erodrigu@tortel
To: info...@sem.brl.mil


In article <HEMSTREE.9...@handel.cs.colostate.edu>, hems...@cs.colostate.edu (unknown) writes:
>
> What is Imake and where can I get the source to use some Imakefiles
> that I have (came with some programs that I ftp'd).
>

Try: man xmkmf (create a Makefile from an Imakefile)

edo...

Eduardo Rodriguez S - --- - --- - --- - erod...@dcc.uchile.cl
Dpto de Ciencias de la Computacion - --- - ...!uunet!uchdcc!erodrigu
Universidad de Chile --- - --- - --- erodrigu%uch...@uchcecvm.BITNET
- --- - --- - --- - --- - --- - --- - --- - --- - --- - --- - --- - ---

-----------------------------

From: Joseph Nathan Hall <jos...@joebloe.maple-shade.nj.us>
Subject: exec-ing script after kill -TERM 1?
Date: 10 Oct 92 05:46:14 GMT
X-Mailer: uAccess - Macintosh Release: 1.5v5
To: info...@sem.brl.mil


Please reply via email: I don't read or receive this group.

I'm wondering if there is a way to set things up so that I can have
a script exec'ed automatically immediately after a kill -TERM 1. The
idea is to automate the process of doing level 0 dumps on a SPARCstation
running SunOS 4.1.2. Currently I just don't know of a way to do an
unattended dump in single-user mode, that is, how to get one started
in single-user mode without having to type exec something-or-other
in the process.

I am not so sure how critical it really is to have the system in
single-user mode during level 0 dumps, anyway. Could a suitable level
of quiescence be achieved by disabling new process creation through
init during the backup? Would killing and restarting some processes
or daemons be necessary? I mean, I could kill whatever I needed to,
then just reboot after the dump .... Hmm. Maybe that's an idea.
I am sufficiently ignorant, however, that I wouldn't know which processes
to kill without some study, or advice. (Latter preferred!)

Just curious, wishing I were surrounded by gurus at work so I wouldn't
have to post embarrassing stuff like this.

uunet!joebloe!joseph (609) 273-8200 day joseph%joe...@uunet.uu.net
2102 Ryan's Run East Rt 38 & 41 Maple Shade NJ 08052
-----My employer isn't paying for this, and my opinions are my own-----

-----------------------------

From: Edward Haymore <haym...@bones.et.byu.edu>
Subject: Help with fork() and exec__()
Date: 10 Oct 92 06:04:16 GMT
Nntp-Posting-Host: bones.et.byu.edu
To: info...@sem.brl.mil

I'm working on a C program that is supposed to execute a unix command using
fork() and execvp(). The sample code the TA gave is as follows:

int pid;
char *file, *array[N];
...
pid = fork();
if ((pid=fork())==0)
{
execvp(file,array);
exit(1);
}
else wait((union wait *)0);

Unfortunately, it doesn't seem to work. The appropriate program executes,
but its output is repeated once... and multiple instances of my C program
seem to be created.

The man pages don't tell me how these function calls are supposed to work
together, and K&R doesn't say anything about it. Can anyone suggest some
improvements to this routine?

Ed Haymore
ed_ha...@byu.edu

-----------------------------

From: Edward Haymore <haym...@bones.et.byu.edu>
Subject: Re: Help with fork() and exec__()
Date: 10 Oct 92 15:36:37 GMT
Nntp-Posting-Host: bones.et.byu.edu
To: info...@sem.brl.mil


Robert Earl pointed out that I was calling fork() twice. I removed the
offending fork() and it works great. Thanks, Robert.

Ed Haymore
ed_ha...@byu.edu

-----------------------------

From: Heng Kek <cce...@nuscc.nus.sg>
Subject: Q: 'Man'ning personal man pages
Date: 10 Oct 92 06:47:35 GMT
X-Newsreader: Tin 1.1 PL4
To: info...@sem.brl.mil

Hello all
I've been wondering how to 'man' a man page in my own
subdirectory. I've read the man pages for 'man' and it
indicates that I should be able to do it via:

man -M <path> <name>

But the system I'm on tells me 'Can't find manual entry for <name>'.
For e.g. if I have a man page called 'help.1l' in my subdir
'~/myman/', what can I specify to 'man' so that that man page is
displayed in the usual 'man'nish way?

Thanks.
Heng Kek
Ultrix 4.2

-----------------------------

From: Mike Krus <kr...@cs.concordia.ca>
Subject: Re: Q: 'Man'ning personal man pages
Date: 10 Oct 92 16:35:59 GMT
Sender: USENET News System <use...@newsflash.concordia.ca>
Nntp-Posting-Host: rho.cs.concordia.ca
To: info...@sem.brl.mil

In article <1992Oct10.0...@nuscc.nus.sg> cce...@nuscc.nus.sg (Heng Kek) writes:
>Hello all
> I've been wondering how to 'man' a man page in my own
>subdirectory. I've read the man pages for 'man' and it
>indicates that I should be able to do it via:
>
>man -M <path> <name>
>
>But the system I'm on tells me 'Can't find manual entry for <name>'.
>For e.g. if I have a man page called 'help.1l' in my subdir
>'~/myman/', what can I specify to 'man' so that that man page is
>displayed in the usual 'man'nish way?

Your directory should have the same structure as /usr/man i.e.
~/myman/man1 ... plus others you should need
Put the man files in the appropriate subfolder (corresponding to the
extension).

Then put in your .cshrc file the following line
setenv MANPATH /usr/man:~/myman
so that you don't have to use the -M option all the time.

>
>Thanks.

no probs

>Heng Kek
>Ultrix 4.2


--
Michael Krus. Email : kr...@cs.concordia.ca
Concordia University Universite d'Orsay - Paris XI
Montreal, Canada Paris, France
What's on television? Looks like a penguin!!!

-----------------------------

From: "David L. Parker" <dlpa...@dlpinc00.rn.com>
Subject: Re: IS UNIX DEAD?
Date: 10 Oct 92 12:00:07 GMT
To: info...@sem.brl.mil

In article <1992Oct8.1...@compu.com> f...@compu.com (Fred Rump from home) writes:
>dans...@Autodesk.COM (Daniel Smith) writes:
>

>> C'mon guys, the Unix pie isn't that big to support so much
>>in-fighting. At the moment, it looks like a slice of lemon, cherry,
>>blueberry... Think of this: if just 10% of approximately 100 million
>>DOS users switch to NT in the next three years, that's what, a bigger
>>slice than any of the existing Unix vendors? any two or three of them
>>put together?
>
>Somehow that thought process is pervasive thruout computerland. But why?
>
>Is it because most people think you must sit in front of a computer in order
>to use it? How many users are there on the typical SCO system for example?
>
>One OS, one box - maybe 10 users?
>
>Take the 600 or 700 hundred thousand SCO licenses out there and multiply. And
>that's only SCO. Add all the minis from everybody who run UNIX and then add
>the workstations somewhere at the end. The workstations like SUNs are the
>smallest quantity of the bunch - but they represent big bucks to SUN as they
>are expensive.
>
>So SUN has what, 2 billion in sales? And SCO has 160 million. But they are
>nowhere equal in actual number of users. SCO is much bigger in that regard.
>
>If I can recall correctly bith have roughly the same number of UNIX licenses
>out there except that SCO hangs lots of terminals on theirs and SUN stands
>alone.
>
>So 10 million NT users are nothing to brag about just yet. By then the number
>of UNIX users will certainly also have grown.
>
>fred
>
>--
>W. Fred Rump office: fr...@COMPU.COM 'mans feet have grown/so big
>26 Warren St. home: fr...@icdi10.compu.com that he/forgets his littleness'
>Beverly, NJ. 08010 Don Marquis
>609-386-6846 bang:uunet!cdin-1!icdi10!fr

But how many of those are people who actually buy a computer themselves for
home use? Some of those people undoubtedly have a dumb terminal hung off an
SCO box at work, and have MS-Windows at home. Or a System 36 or even a 32
at work and DOS or Win. at home.

I think the point (and I'm sure I'm probably missing one or more) is not
so much which will rule (was that even the original point?), but what will
happen when (not if, when) significant numbers of people get to make their
own comparisons between NT and the various new flavors of UNIX (whether it's
4.2 or a polished, commercially competitive linux, or whatever). If NT lives
up to it's potential (not hype, but potential - it is based on the Mach 3.0
kernel, right?, and Billy'$ billion$ have apparently hired some pretty fine
programmer$) then NT will be a factor in the UNIX world and not just something
for the UNIX cognoscenti to look down their noses at - as in lot's of NT
"power users" running NT workstations hooked up to UNIX servers. The SUNs
and dumb terminals won't disappear, but the ancient minis will.

Just the incoherent ravings of a caffeine-stoked news addict.
--
Dave Parker
Automated Data Management Services, Pleasant Hill, MO 64080-1331
(816) 987-5167/5218 voice/fax

-----------------------------

From: Dave Schaumann <da...@cs.arizona.edu>
Subject: Re: IS UNIX DEAD?
Date: 11 Oct 92 06:17:03 GMT
Sender: ne...@organpipe.uug.arizona.edu
To: info...@sem.brl.mil

In article <1b1joh...@bigboote.WPI.EDU>, mugsy@winton (Michael G. Bruce) writes:


>In article <1992Oct8.1...@maths.tcd.ie> ro...@maths.tcd.ie (Robert Bashford) writes:
>>pardon me for asking but WTF is NT?
>>
>

>A figment of Bill Gates' mind... ;)
>(flames/cheers welcome)

Yeah... y'see, they decided that there might be some life in DOS after
all, so they came up with "Disk Operating System -- New Technology".
With the appropriate acronym, of course... ;-)

--
The security of the Enterprise is of Paramount importance.
-Jean Luc Picard, stardate 45965.3

-----------------------------

From: Malcolm Mladenovic <m...@dsbc.icl.co.uk>
Subject: Re: prtvtoc (SVR4) vs. dkinfo (SUN OS 4.1.1)
Keywords: prtvtoc
Date: 10 Oct 92 13:34:26 GMT
To: info...@sem.brl.mil

In article <Oct.9.20.28....@ocean.rutgers.edu> ji...@ocean.rutgers.edu (Jim Gasprich) writes:
>In SVR4, there is a command called prtvtoc (print Volume Table of Contents),
>which should give me what I want, but alas, does not seem to work. Here's the
>lowdown:
>
> # df
> /grass (/dev/dsk/c0t1d0s1): 665250 blocks 40822 files
>
> # prtvtoc /dev/rdsk/c0t1d0s1
> prtvtoc: device /dev/rdsk/c0t1d0s1 is not a slice 0 device
> prtvtoc [-a] [-e] [-p] [-f filename] raw-device

You need to use the slice 0 device (as indicated by the message).

prtvtoc /dev/rdsk/c0t1d0s0

should print all the section information.

The options mentioned are
-a prints alternate track info on non-SCSI drives
-e updates /etc/partitions
-p prints pdinfo structure (disk geometry)
-f condensed version of default output for use with edvtoc

-Malcolm

-----------------------------

From: Bill the CAT <wes...@stein.u.washington.edu>
Subject: talk messages
Date: 10 Oct 92 17:15:29 GMT
Sender: USENET News System <ne...@u.washington.edu>
To: info...@sem.brl.mil


The message "checking for invitation on callers machine" appears when trying
to talk with another user on the same machine. It seems to freeze the operation. Does anyone know how to fix this problem?
reply email to wes...@u.washington.edu
thanks for any help here.

-----------------------------

From: Russell Mosemann <mose...@unlinfo.unl.edu>
Subject: tset when term=vt300 (a.k.a. offering a choice)
Keywords: tset term unknown
Date: 11 Oct 92 04:59:31 GMT
Sender: ne...@unlinfo.unl.edu
Nntp-Posting-Host: unlinfo.unl.edu
To: info...@sem.brl.mil


I would like to put a line in my .login so that when I login from a
terminal with an unknown type, tset will offer to use the type of vt100.
Otherwise, I want it to go ahead with the original terminal type.
For example, if I login from a terminal that advertises itself as a
vt300, term and TERM are set accordingly. tset says it is unknown and
wants to use unknown as the type.

eval `tset -sQ`
Type vt300 unknown
TERM = (unknown)

How can I get it to say TERM = (vt100) for this unknown vt300 (and
any other unknown terminals, I don't want to type all of the unknown
terminal types in)? Any nifty ideas? These terminals would be marked
as network in ttytab. As a side question, is there any place where I can
get definitions for a vt300 and a vt400? Thanks.
--
Russell
mose...@unl.edu

-----------------------------

From: Ian Peattie <ipea...@nyx.cs.du.edu>
Subject: Re: tset when term=vt300 (a.k.a. offering a choice)
Keywords: tset term unknown
Date: 11 Oct 92 12:06:12 GMT
Sender: netnews admin account <use...@mnemosyne.cs.du.edu>
X-Disclaimer: Nyx is a public access Unix system run by the University
of Denver for the Denver community. The University has neither
control over nor responsibility for the opinions of users.
To: info...@sem.brl.mil

In article <1992Oct11.0...@unlinfo.unl.edu> mose...@unl.edu writes:
> I would like to put a line in my .login so that when I login from a
>terminal with an unknown type, tset will offer to use the type of vt100.
>Otherwise, I want it to go ahead with the original terminal type.
> For example, if I login from a terminal that advertises itself as a
>vt300, term and TERM are set accordingly. tset says it is unknown and
>wants to use unknown as the type.
>
>eval `tset -sQ`
>Type vt300 unknown
>TERM = (unknown)
>
> How can I get it to say TERM = (vt100) for this unknown vt300 (and
>any other unknown terminals, I don't want to type all of the unknown
>terminal types in)? Any nifty ideas? These terminals would be marked
>as network in ttytab. As a side question, is there any place where I can
>get definitions for a vt300 and a vt400? Thanks.
>--
>Russell
>mose...@unl.edu

Try using the mapping flag -m

tset -m network:vt100 -m :\?vt100

This will set your terminal as a vt100 if there is an entry for 'network' for
that line, else it will prompt with TERM=(vt100).

Ian
----*

-----------------------------

From: "Michael C. KWAN" <mk...@esk.compserv.utas.edu.au>
Subject: copying a file without login
Date: 11 Oct 92 05:52:50 GMT
Sender: ne...@cam.compserv.utas.edu.au
Nntp-Posting-Host: esk
To: info...@sem.brl.mil


Can I copy a file from another account (under same host) without using
ftp, rlogin (rhosts) ? If I know the password of that account.

Thanks in advance.


Michael

-----------------------------

From: Bob Barker <bar...@wd0gol.wd0gol.mn.org>
Subject: How to delete trailing blanks from data?
Keywords: regular expressions, ed
Date: 11 Oct 92 06:30:51 GMT
Followup-To: poster
To: info...@sem.brl.mil

This ought to be an easy thing to do, and I'm sure it is, but I can't
come up with a regular expression that will remove trailing blanks from
a string.

Can anybody help me out?

Thanks,

-Bob
------------------------------------------------------------------------------
Bob Barker ...!uunet!umn-cs!tcnet!wd0gol!barker
Robert Barker & Associates bar...@wd0gol.MN.ORG
(612) 949-0140

-----------------------------

From: MONK <asri...@vela.acs.oakland.edu>
Subject: 'w' command
Date: 11 Oct 92 07:35:55 GMT
To: info...@sem.brl.mil


Hi folks

The 'w' or the what command seem to intrude the privacy, IS there any way


to mask what the user is doing, to a foreign user executing the w command.
The only way i thought so was by Starting a script, which creates a virtual
shell.

Thanks
_________________________________________________________________________
athi
_________________________________________________________________________

Internet: : Yellnet:
asri...@vela.acs.oakland.edu : 313-370-4357(work)
_________________________________________________________________________

--
_________________________________________________________________________
athi
_________________________________________________________________________

-----------------------------

From: Smiley <jal4...@uxa.cso.uiuc.edu>
Subject: Re: 'w' command
Date: 11 Oct 92 18:18:20 GMT
Sender: Net Noise owner <use...@ux3.cso.uiuc.edu>
To: info...@sem.brl.mil

asri...@vela.acs.oakland.edu (MONK) writes:
:)The 'w' or the what command seem to intrude the privacy, IS there any way
:)to mask what the user is doing, to a foreign user executing the w command.
:)The only way i thought so was by Starting a script, which creates a virtual
:)shell.

I usually run a few programs in the background, all of which spend about
a minute sleeping each loop. A "w" on myself shows only that I'm sleeping.

The problem is, "ps aux | grep <user>" will reveal all processes anyway.
--
Josh Laff # #
email to: smi...@uiuc.edu _ _ Hello! I am a signature virus!
(217) 384-6249 |#\_____/#| Join the fun and copy mo*#(*&^!>.
\#######/

-----------------------------

From: ullas gargi <sl...@io.ee.usu.edu>
Subject: savehist and .history
Date: 11 Oct 92 09:05:33 GMT
Nntp-Posting-Host: io.ee.usu.edu
To: info...@sem.brl.mil

Hi,

I am running X11 on a Sun 4. My .cshrc contains a line that says
"set savehist=2000"
However, only commands that I execute on my console window are
recorded in .history, not ones that I execute in various other
xterms. Why?


Ullas Gargi
Utah State University

REGI's

unread,
Oct 15, 1992, 11:00:20 AM10/15/92
to
>X-Envelope-to: info...@BRL.mil
>X-VMS-To: IN::"info...@BRL.MIL"

1
15-OCT-1992 10:05:17.60
1 00:00:00.00
16-OCT-1992 10:05:17.60
info-uni...@sem.brl.mil
raf...@obelix.cica.es

Received: from SEM.BRL.MIL by ESEVVX.CICA.ES ; 12-OCT-1992 10:05:14.15
Received: from SEM.BRL.MIL by SEM.BRL.MIL id aa13434; 12 Oct 92 3:46 EDT
Received: from wharf.brl.mil by SEM.BRL.MIL id aa13425; 12 Oct 92 3:34 EDT
Received: from relay.iunet.it by WHARF.BRL.MIL id aa06572; 12 Oct 92 3:28 EDT
Received: from jrc.UUCP by relay.iunet.it with UUCP
(5.61++/IDA-1.2.8) id AA02233; Mon, 12 Oct 92 08:29:41 +0100
Received: from iss.isei.jrc.it (is) by jrc.it; Mon, 12 Oct 92 08:12:53 +0100
From: Martyn Dowell <martyn...@cen.jrc.it>
Date: Mon, 12 Oct 92 08:14:35 +0100
Message-Id: <9754.92...@iss.isei.jrc.it>
To: info...@BRL.MIL
Subject: Unsubscribe

unsubscribe me please
m_do...@jrc.it

REGI's

unread,
Oct 15, 1992, 12:02:27 PM10/15/92
to
>X-Envelope-to: INFO...@BRL.mil
>X-VMS-To: IN::"INFO...@BRL.MIL"

1
14-OCT-1992 02:22:38.15
1 00:00:00.00
15-OCT-1992 02:22:38.15
info-uni...@sem.brl.mil
raf...@obelix.cica.es

Received: from SEM.BRL.MIL by ESEVVX.CICA.ES ; 11-OCT-1992 02:20:51.18
Received: from SEM.BRL.MIL by SEM.BRL.MIL id ab04499; 10 Oct 92 15:27 EDT
Received: from sem.brl.mil by SEM.BRL.MIL id aa04488; 10 Oct 92 15:16 EDT
Date: Sat, 10 Oct 92 15:16:33 EST


From: The Moderator (Mike Muuss) <Info-Uni...@BRL.MIL>
To: INFO...@BRL.MIL
Reply-To: INFO...@BRL.MIL

Subject: INFO-UNIX Digest V16#034
Message-ID: <921010151...@SEM.BRL.MIL>

INFO-UNIX Digest Sat, 10 Oct 1992 V16#034

Today's Topics:
Suggestions for good Unix5.4 tutorial.
Re: Print files using printers belong to a different workstation?
Sending email to the States
Re: Remote Printing from HP to BSD systems
Re: Can you write/talk to a terminal which set "mesg -n"?
A QUESTION
Re: A QUESTION
Re: NT Under SCO Unix
Looking for typing tutorial running under UNIX...
Need public domain source control system
Re: IS UNIX DEAD?
Re: Unix Fax Servers
Re: Need # of screen rows for shell variable
<None>
Re: passing output of ftp site to shell
Imakefile???
Re: BEGINNER Q.: redirection and awk?
UNIX physical memory control
Re: UNIX physical memory control
Is there a Unix utility to determine memory usage of an application ?
Anon FTP almost setup - ls problem
Block size/Version No. question
Fortran compiler or f2c translator
Man page naming convention
Re: Man page naming convention
Login shell
Manipulating strings in batch file
Re: Manipulating strings in batch file
Re: Multiple Users for Windows/NT


Re: MIT X11R5 problem with SUID & SGID

changing control terminal
NFS problem?
Anyone can remove files


Re: Anyone can remove files
Profiling on shared library..

Re: Profiling on shared library..
Sockets and stuff
Re: Sockets and stuff
Re: Solbourne blues, in Boot minor
Re: comminicating with devices
Welcome to comp.unix.questions [Monthly posting]
Frequently Asked Questions about Unix (index) [Monthly posting]
Frequently Asked Questions about Unix (1/4) [Monthly posting]
Frequently Asked Questions about Unix (2/4) [Monthly posting]
Frequently Asked Questions about Unix (4/4) [Monthly posting]
Frequently Asked Questions about Unix (3/4) [Monthly posting]
Device driver (I/O)
Printing to a serial postscript printer hangs printer.
When to use libcurses
Problem with dd and tar file on exabyte
Converting comp_t type to something more integerish.
Re: PC/NFS vs Netware


prtvtoc (SVR4) vs. dkinfo (SUN OS 4.1.1)

kernel to nonkernel ipc
rn
PKZIP for unix? (pkzip version 1.10)
-----------------------------------------------------------------

From: Ken McClaren <kmcc...@ncrclm.clemsonsc.ncr.com>
Subject: Suggestions for good Unix5.4 tutorial.
Date: 6 Oct 92 16:35:26 GMT
To: info...@sem.brl.mil

I'm looking for a good UNIX 5.4 tutorial. Does anyone have any suggestions?
My background is in DOS.

thanks in advance.
ken.
P.S. please respond to my email address.

--

-----------------------------

From: Sascha Welter <sas...@sfb313.uni-kiel.dbp.de>
Subject: Re: Print files using printers belong to a different workstation?
Date: 7 Oct 92 02:08:42 GMT
Followup-To: comp.unix.questions
To: info...@sem.brl.mil

Hi Dave,

at first, the -s flag from the lpr command is used to prevent the local
printer daemon from copying the users file to the printer queues spool area.
In Your case it will solve the problem, because the printer daemons don"t
share file systems.
You have to contact both system administrators, from workstation1
and workstation2, to set up a remote printer queue. Let"s say the printer
queues for remote printing from workstation1 to workstation2 is named r12
and the queue for the opposit direction is named r21. Then You have to call
the printer by:
lpr -s -Pr12 <filename>
to print a file from workstation1 on the printer of workstation2.

I hope this will help a little bit....

Hasta pronto, Sascha

--
-------------------------------------------------------------------------------
sascha welter sas...@sfb313.uni-kiel.dbp.de
-------------------------------------------------------------------------------

-----------------------------

From: "Mr. I. Rowland" <scs...@csc.liv.ac.uk>
Subject: Sending email to the States
Date: 7 Oct 92 10:51:23 GMT
Sender: News Eater <ne...@csc.liv.ac.uk>
Nntp-Posting-Host: hod.csc.liv.ac.uk
To: info...@sem.brl.mil

Keywords:

I need to get in touch with someone at UCSC to find out if I can mail messages to a friend who is studying there. Does anybody know who to send the query to or how I can find out.

-----------------------------

From: Alan Yasutovich <ya...@ll.mit.edu>
Subject: Re: Remote Printing from HP to BSD systems
Date: 7 Oct 92 17:52:17 GMT
Sender: ne...@ll.mit.edu
To: info...@sem.brl.mil

In article <1992Oct7.0...@autelca.ascom.ch> nbl...@autelca.ascom.ch (Norbert Bladt) writes:
>ste...@hpc.mentorg.com (Steve Jumonville) writes:
>
>
>>System V printing is painful to use if you're not familiar with it.
>Yes. I completely agree with this statement.
>
>>I suggest you use the menu driven 'sam' utility (System Admin Manager) to
>>set up printing to BSD. When you're in sam, follow the menu tree down through
>>peripherals, printers and plotters, to "setting up a remote printer". If you
>>have questions, use the "Help" funciton key.
>We solved it in a very simple way:
> chown lp /usr/bin/lp
> chmod u+s /usr/bin/lp (now /usr/bin/lp is running as user "lp" !)
>This is necessary because on every *n*x system around there is an user "lp".
j(At least, on any *n*x system we have here, HP's, SUN's, Interactive UNIX, etc.)
>Now you can write a simple model/interface file which just does a remote shell
>on the other system and that's it.
>Something like
> cat file | 'rsh BSDhost lp -Pbsd-printer-name'
>
>>By the way, run 'sam' in an 'hpterm' window if you want access to function keys.
>I guess, that you could do it with 'sam' on HP's, we never used it on
>System V.
>
>Hope this helps,
>
>Norbert.

How about this. How do you print directly to a printer
which is on a terminal server.

You need ip address and port address on the server.


????

--
Alan Yasutovich
"inquiring (and nosey) minds WANT TO KNOW!!!"
I can remember when "safe sex" meant having a padded headboard!!
Tick Tock.....Tick Tock......Tick Tock .....Tick Tock......

-----------------------------

From: Barry Margolin <bar...@think.com>
Subject: Re: Can you write/talk to a terminal which set "mesg -n"?
Date: 7 Oct 92 18:25:49 GMT
NNTP-Posting-Host: telecaster.think.com
To: info...@sem.brl.mil

In article <1992Oct7....@monu1.cc.monash.edu.au> gu...@monu1.cc.monash.edu.au) (Lost in C! :-) writes:
>Could anyone tell me that if we can write/talk to a terminal which
>set "mesg -n"? I heard someone said that it is possible if we know
>which port to write to. I'm very new to Unix and very confused.

No, you can't. "Mesg -n" works by changing the permissions on the terminal
so that only the user can access it.

Acually, there are two exceptions: the superuser can write to anyone, and
if you're logged in as the same user who has turned messages off you can
write to him.


--
Barry Margolin
System Manager, Thinking Machines Corp.

bar...@think.com {uunet,harvard}!think!barmar

-----------------------------

From: Sekhar Chitti <csc...@hertz.njit.edu>
Subject: A QUESTION
Date: 7 Oct 92 21:23:28 GMT
Sender: csc...@hertz.njit.edu
Nntp-Posting-Host: hertz.njit.edu
To: info...@sem.brl.mil

Hi netters,

I have a question on using 'sed' and 'awk' to edit a text file.
I have a text file of nearly 500 lines and having 6 fields.
Now that I wanna delete the last 5 fields of each line and
keep only the first one. What is the easiest way I can do this?
I am a bit familiar with sed and awk. But don't know exactly
how I can use them to do this? Could anybody help me in this
regard? Thanks.

Sekhar
csc...@hertz.njit.edu

--
Sekhar P Chitti
381 Broad Street, Apartment #2109-A,
Newark, NJ - 07104
Phone # 201-482-2801 (res)

-----------------------------

From: John Gordon <gor...@osiris.cso.uiuc.edu>
Subject: Re: A QUESTION
Date: 8 Oct 92 04:56:50 GMT
Sender: Net Noise owner <use...@news.cso.uiuc.edu>
To: info...@sem.brl.mil

csc...@hertz.njit.edu (Sekhar Chitti) writes:

>Hi netters,

>I have a question on using 'sed' and 'awk' to edit a text file.
>I have a text file of nearly 500 lines and having 6 fields.
>Now that I wanna delete the last 5 fields of each line and
>keep only the first one. What is the easiest way I can do this?
>I am a bit familiar with sed and awk. But don't know exactly
>how I can use them to do this? Could anybody help me in this
>regard? Thanks.

% cat datafile | awk '{print $1}'

(Of course, this assumes that spaces are the field separator. If
some other character is the field seperator, insert a -F<char> right after
the awk.)

---
John Gordon My incredibly witty saying has been
gor...@osiris.cso.uiuc.edu Politically Corrected into oblivion.

-----------------------------

From: John Ellithorpe <jd...@zenobia.mit.edu>
Subject: Re: A QUESTION

Date: 8 Oct 92 22:58:47 GMT
Sender: News system <ne...@athena.mit.edu>
Nntp-Posting-Host: zenobia.mit.edu
To: info...@sem.brl.mil

On 7 Oct 92 21:23:28 GMT, csc...@hertz.njit.edu (Sekhar Chitti) said:
> Nntp-Posting-Host: hertz.njit.edu
> Hi netters,

> I have a question on using 'sed' and 'awk' to edit a text file.
> I have a text file of nearly 500 lines and having 6 fields.
> Now that I wanna delete the last 5 fields of each line and
> keep only the first one. What is the easiest way I can do this?
> I am a bit familiar with sed and awk. But don't know exactly
> how I can use them to do this? Could anybody help me in this
> regard? Thanks.

All you need is:

awk '{print $1}' < input-file > output-file

and there you have it.

John
--

===============================================================================
John Ellithorpe | Internet: jd...@maggie.mit.edu
Dept. of Physics, Rm 26-349 | Phone : (617) 253-3074 Office
Massachusetts Institute of Technology | (617) 253-3072 Lab
Cambridge, MA 02139 | (617) 236-4910 Home
===============================================================================

-----------------------------

From: Rob <rdo...@jade.tufts.edu>
Subject: Re: A QUESTION

Date: 9 Oct 92 23:09:12 GMT
Sender: USENET News System <ne...@news.tufts.edu>
To: info...@sem.brl.mil

Since nobody suggested cut...
how about:

cat file | cut -d' ' -f1

Note that you can change the delimeter (-d) to whatever you want to,
here I set to space.

Rob
--

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

-----------------------------

From: Alistair Banks <alis...@microsoft.com>
Subject: Re: NT Under SCO Unix
Date: 7 Oct 92 21:44:06 GMT
To: info...@sem.brl.mil

May I request that this thread is taken over to .advocacy groups. It
has degenerated irretrievably from an questions about plans into a
debate about the realtive merits of UI techniques - this is way off
the subject matter of Win32 API programming.

-- Alistair

-----------------------------

From: Nitin Borwankar <ni...@ingres.com>
Subject: Re: NT Under SCO Unix
Date: 9 Oct 92 21:55:13 GMT
To: info...@sem.brl.mil

In article <1992Oct07.2...@microsoft.com> alis...@microsoft.com (Alistair Banks) writes:
>May I request that this thread is taken over to .advocacy groups. It
>has degenerated irretrievably from an questions about plans into a
>debate about the realtive merits of UI techniques - this is way off
>the subject matter of Win32 API programming.
>
>-- Alistair

Thank you!! YES !!

Nitin Borwankar,
ni...@ingres.com **** visualize whirled peas ****

-----------------------------

From: William Daul <bi...@informix.com>
Subject: Looking for typing tutorial running under UNIX...
Date: 7 Oct 92 22:12:11 GMT
Sender: Usenet News <ne...@informix.com>
Originator: billd@cheetah
To: info...@sem.brl.mil

Is there such a shareware application? How about a $$$-ware application?

Thanks, --Bill
--
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
William Daul Advanced Support INFORMIX SOFTWARE INC.
4100 Bohannon Dr. (415) 926-6488 - wk
Menlo Park, CA. 94025 uunet!infmx!billd or bi...@informix.com

-----------------------------

From: Proactive Software <pro...@netcom.com>
Subject: Need public domain source control system
Date: 7 Oct 92 23:24:53 GMT
To: info...@sem.brl.mil

My company is using the SCCS for now and we have tried to look into
PVCS but it is too expensive.

I will appreciate any information about public domain source control
system: where to get the source code, etc.
I am also looking for RCS and converter to convert SCCS format to RCS
format.

Please reply by e-mail as I don't have good Usenet News access.
Thank you.

Lak Ming Lam
l...@proactive.com

-----------------------------

From: Daniel Smith <dans...@autodesk.com>
Subject: Re: IS UNIX DEAD?

Date: 8 Oct 92 00:48:24 GMT
To: info...@sem.brl.mil

In <58...@ucsbcsl.ucsb.edu> har...@engrhub.ucsb.edu (Harley Hahn) writes:
> What do you think about the question "Is Unix Dead?" What would
> you tell someone who asks if this is true?

I think it's heading that way, but "not yet". Most of the
problem seems to be endless bickering among the different vendors
of OS's and GUI's. I've been around Unix for 10 years, and am
starting to feel like that's enough, waiting for it to really get its


act together. I'm going to slant my future learning efforts towards NT.

C'mon guys, the Unix pie isn't that big to support so much


in-fighting. At the moment, it looks like a slice of lemon, cherry,
blueberry... Think of this: if just 10% of approximately 100 million
DOS users switch to NT in the next three years, that's what, a bigger
slice than any of the existing Unix vendors? any two or three of them
put together?

Cooperate, don't Litigate.

Daniel
--

Daniel Smith, Autodesk, Sausalito, California, (415) 332-2344 x 2580

Disclaimer: written by a highly caffeinated mammal
dans...@autodesk.com dans...@well.sf.ca.us

-----------------------------

dans...@Autodesk.COM (Daniel Smith) writes:

fred

-----------------------------

>dans...@Autodesk.COM (Daniel Smith) writes:

Camon guys! This sort of discussion is nonsense. The more people that
use computers, the more ways computers will be used. One size does not
fit all, and never will. Unix, in some form or another, will be around
for some time to come, so will WindowsNT, DOS, MacOS, and so on. From
what I understand there are still die hard CPM users out there. I
strongly suspect that the operating system of the future will be none
of these, but something completely different.

Gene Kochanowsky
ge...@aee.com
--
Gene Kochanowsky | "And remember ....
Associated Electronic Engineers, Inc. | The better you look ...
(904)893-6741 Voice, (904)893-2758 Fax | the more you will see."
ge...@aee.com | Miss Lidia

-----------------------------

From: Steve Elias <e...@spdcc.com>
Subject: Re: Unix Fax Servers
Date: 8 Oct 92 01:03:16 GMT
To: info...@sem.brl.mil


s...@wimsey.bc.ca (Stuart Lynne) writes:
> e...@spdcc.com (Steve Elias) writes:
>>those concerned with legalities might want to
>>note that faxback is a patented thang (IFF the fax is
>>sent out via a separate phone call.)
>
>We'll also note that there are several good examples of the technology
>concerned that pre-date the patent application date that should lead to
>the patent being thrown out if and when it gets to court.

i think that's absolute hogwash, but to each his own.

>The patent covers use of signals (i.e. DTMF tones) to control the delivery
>of faxes from a computer system.

i think the above statement overstates what the patent covers.

> For example, Globefax a service like this
>was in place and being offerred commercially in Canada in January of 1988 by
>Teleglobe Canda. The patent application date is May 11, 1988.

sorry, but i reject your armchair patent lawyering and do not
want to engage in that any more than i've already done.

let's let the lawyers deal with that crap elsewhere
and keep only the crucial tech info here, eh? in this case,
the crucial info is that there is a patent.

>I've only been peripherally involved so I don't have uptodate details
>but it's my understanding that there is currently an industry group that
>will be sponsoring a challenge.

you've gotta be kidding.
an industry group? why would it take an "industry group" to fight
such a nice little fish company's patent? (rhetorical question).

/eli
--
/* e...@spdcc.com */

-----------------------------

From: Patrick Goebel <pat...@casbs.stanford.edu>
Subject: Re: Need # of screen rows for shell variable
Date: 8 Oct 92 02:21:46 GMT
Sender: Patrick Goebel <pat...@casbs.stanford.edu>
Approved: news
To: info...@sem.brl.mil


Earlier I asked the net:

> I need to determine the number of rows on a user's terminal screen for
> a shell script I am writing.

Many thanks for all the ingenious answers. Here a few in case you
need one yourself some day.

(1) rows=`echo $TERMCAP | sed 's/.*:li#\([0-9][0-9]*\):.*/\1/'`

(2) hmm...our HPs have environment variables that are called LINES and
COLUMNS that do what you want...

(3) tput cols
tput lines

Reads terminfo. Works in SysVr3 from SCO.

And my favorite (i.e. the one I will use):

(4) stty size | awk '{ print $1 }'

works for me on SUNOS4.1.2, CONVEX(argh), and UNICOS (Cray YMP)
systems.


Cheers,
patrick
--
Patrick Goebel E-MAIL: pat...@casbs.Stanford.EDU
Network Administrator VOICE: (415) 321-2052
CASBS, 202 Junipero Serra Blvd. FAX: (415) 321-1192
Stanford, CA 94305 BEEPER: Temporarily Out of Order...

-----------------------------

From: gmh...@v9000.ntu.ac.sg
Subject: <None>
Date: 8 Oct 92 02:27:39 GMT
Sender: USENET News System <ne...@ntuix.ntu.ac.sg>
Nntp-Posting-Host: v9001.ntu.ac.sg
To: info...@sem.brl.mil

Hi there,

I have just installed AT&T UNIX System V Rel 4 into my 486 PC and I am having
problems making use of my serial port (ie com1) to communicate with PLC or
robot controller. (I could not open the special file /dev/tty00 which is
configured as the serial port). I believe that I have not configured the system
properly.

I would appreciate it if you could enlighten me. Thank for the enlightment in
advance.

-----------------------------

From: Bill the CAT <wes...@stein.u.washington.edu>
Subject: Re: passing output of ftp site to shell
Keywords: shell, csh, scripts, ftp
Date: 8 Oct 92 03:21:26 GMT
Sender: USENET News System <ne...@u.washington.edu>
To: info...@sem.brl.mil

How can you pass ftp remote output to a csh script?

-----------------------------

From: unknown <hems...@cs.colostate.edu>
Subject: Imakefile???
Date: 8 Oct 92 03:31:52 GMT
Sender: News Account <ne...@yuma.acns.colostate.edu>
To: info...@sem.brl.mil


What is Imake and where can I get the source to use some Imakefiles
that I have (came with some programs that I ftp'd).

Thanks for the help,

Charles
--
!===========================================================================!
! Charles H. Hemstreet IV !internet: hems...@handel.cs.Colostate.Edu !
! Colorado State University ! Professional College Student !
!===========================================================================!

-----------------------------

From: John Gordon <gor...@osiris.cso.uiuc.edu>
Subject: Re: BEGINNER Q.: redirection and awk?
Keywords: cd,prompt,path,pwd
Date: 8 Oct 92 04:52:13 GMT
Sender: Net Noise owner <use...@ux3.cso.uiuc.edu>
To: info...@sem.brl.mil

dcu...@eng.clemson.edu (david cullen) writes:

>I hate asking this, but i've forgotten how to do it in unix.

>How can I get my working directory to show up in my prompt?

1) Set your prompt to have a pwd command embedded in it
2) Alias 'cd' so that it re-sets your prompt to the new directory
3) Also alias any other dir-changing commands, such as pushd, popd

-----------------------------

From: Graham Hausler <hau...@aldetec.oz.au>
Subject: UNIX physical memory control
Date: 8 Oct 92 08:45:53 GMT
To: info...@sem.brl.mil

I require some information concerning device drivers and UNIX memory
manipulation.

I am developing a VME device driver on a MVME187 System V/88 system (R3V7)
and wish to map some of the physical memory to the VME space. I have had
a look at the device driver documentation and cannot see how I can 'remove'
pages of UNIX physical memory from the system so I can use it on the VME
bus. Am I wrong in thinking that a device driver cannot lock/reserve physical
memory from the UNIX free memory lists ? Alternatively, I have seen
reference to the device /dev/kmem (and /dev/mem ??) at various times, does
this device allow me to modify the physical memory available to UNIX ? If so,
where do I obtain information on controlling/accessing this device ? Are
there any other alternatives ?

Please email any responses directly, I will post a summary if requested.

Thanks
Graham Hausler.

--
Internet: hau...@aldetec.oz.au --> GEMCO, Perth, Australia.

-----------------------------

From: Jack Craig <ja...@admin.mport.com>
Subject: Re: UNIX physical memory control
Date: 9 Oct 92 19:55:51 GMT
Followup-To: comp.unix.questions
To: info...@sem.brl.mil

hau...@aldetec.oz.au (Graham Hausler) writes:

>I require some information concerning device drivers and UNIX memory
>manipulation.
>
>I am developing a VME device driver on a MVME187 System V/88 system (R3V7)
>and wish to map some of the physical memory to the VME space. I have had
>a look at the device driver documentation and cannot see how I can 'remove'
>pages of UNIX physical memory from the system so I can use it on the VME
>bus. Am I wrong in thinking that a device driver cannot lock/reserve physical

is there a reason you cant sptalloc(count, foo...)

in your xx_init() routine. usually the best time to grab that suff is when
you're booting. find some ddi/ddk doc on sptalloc(), sptfree()

=============================================================================
Jack Craig Microport SVR4 408-438-UNIX uunet!mport.com!jack
Software Horizons SVR3 408-684-1375 uunet!sco.com!blznrzn!jack
=============================================================================

>--
>Internet: hau...@aldetec.oz.au --> GEMCO, Perth, Australia.

-----------------------------

From: breh...@ul.ie
Subject: Is there a Unix utility to determine memory usage of an application ?
Date: 8 Oct 92 13:40:47 GMT
To: info...@sem.brl.mil

Can anybody out there in Internetland tell me if there is a Unix
utility available that can analyse/determine memory usage & allocation
of an application at run-time. Something that runs in the background
while the application runs in the foreground perhaps.

Does something like this exist ?. If so, is it freeware/shareware
and where can I find it.

Thanks in advance.

Tom Brehony.
University of Limerick, Ireland.
Email : breh...@ul.ie

-----------------------------

From: michael a migdol <mmi...@ccwf.cc.utexas.edu>
Subject: Anon FTP almost setup - ls problem
Date: 8 Oct 92 15:47:24 GMT
Sender: ne...@ut-emx.uucp
Followup-To: comp.unix.questions
Originator: mmi...@grumpy.cc.utexas.edu
To: info...@sem.brl.mil

I'm trying to setup anon. ftp on my Dell 486 running Dell sysvR4. Everything
seems to work ok so far - I can log in ok, move around the directory structure,
get files, etc. But when I ls, I don't get any output; I get the standard
"Opening ASCII connection message", but it transmits 0 bytes. I've checked and
double checked all my modes, tried putting copies of the ls executable in
~ftp, ~ftp/bin, and ~ftp/usr/bin, all to no avail.

Dell's Tech support, as well as my college's tech support haven't been able to
figure this one out.

Does anyone out there have any suggestions?

Thanx in advance...
Michael (please respond by mail if possible)

-----------------------------

From: Ken Beer <kb...@wam.umd.edu>
Subject: Block size/Version No. question
Date: 8 Oct 92 16:39:46 GMT
Sender: USENET News system <use...@wam.umd.edu>
Nntp-Posting-Host: rac1.wam.umd.edu
To: info...@sem.brl.mil


I working on an old system with no man pages and a scarcity of gurus.
I would like to know the block size for the tape drive. Is there any way
to do this from UNIXtm? (i.e. without having to take apart the drive
or sending away for long forgotten manuals?)

Also, is there a way to determine which version of Unix you are using
directly, withosing some technique like, "It supports aliasing, it
must be Sys.V" or whatever?

THANKS,


--

- |< E /\/

kb...@wam.umd.edu

-----------------------------

From: WSHB Operations Eng <mich...@wshb.csms.com>
Subject: Fortran compiler or f2c translator
Date: 8 Oct 92 17:42:55 GMT
Followup-To: poster
To: info...@sem.brl.mil

Help! I've got an old Fortran program that is for VMS. I want to get it
running on an SCO Xenix box, but I don't know too much about Fortran, nor
do I have a Fortran compiler. The source code is one giant file, not a
bunch of small modules like I'm used to, and it's a little over 400 pages
long once I print it out.

Does anyone have any recommendations about how to proceed. I know there is
a translator named f2c available on some archive. Does it really work very
well with something this size. I really can't spend the time to sit down
and piece it together by myself, even if I had the experience in C to try
something so foolish. I do have gcc if it would be better than cc to deal
with the output of f2c.

As an alternative, is there some Fortran compiler out there I could grab
off an archive and get working. Or would I be forced to buy a comercial
compiler? Is Fortran standard enough that I could probably get it running
on Xenix without a lot of debugging if I can get a compiler?

Or, maybe, is it cheaper to just get an old microvax from somewhere and get
it running in the environment it was designed for? How many $$ would I be
looking at to get a used machine and licenses to get it going?

Thanks in advance,
Michael
--
Michael Batchelor--Systems/Operations Engineer #compliments and complaints
WSHB - An International Broadcast Station of # lett...@csms.com
Herald Broadcasting Syndicate, Inc. #technical questions and reports
mich...@wshb.csms.com +1 803 625 5552 # letterb...@csms.com

-----------------------------

From: Barry Margolin <bar...@think.com>
Subject: Man page naming convention
Date: 8 Oct 92 17:54:04 GMT
NNTP-Posting-Host: telecaster.think.com
To: info...@sem.brl.mil

This is the kind of silly question I usually answer, but now I've come up
with one of my own....

Why does the man command require the section number of the man page entry
to be in the file name suffix, when it's already in the directory name?
One possibility I considered is that it would allow you to link all the
man<section> directories together if you wanted; however, I'm under the
impression that the naming convention predates symbolic links (the only
directory links that are normally permitted).


--
Barry Margolin
System Manager, Thinking Machines Corp.

bar...@think.com {uunet,harvard}!think!barmar

-----------------------------

From: Barry Margolin <bar...@think.com>
Subject: Re: Man page naming convention
Date: 8 Oct 92 20:12:23 GMT
NNTP-Posting-Host: telecaster.think.com
To: info...@sem.brl.mil

In article <1992Oct8.1...@news.eng.convex.com> tch...@convex.COM (Tom Christiansen) writes:
>:Why does the man command require the section number of the man page entry
>:to be in the file name suffix, when it's already in the directory name?

>One reason is that people can have one man3 directory that contains
>both system.3 (or 3c) and system.3f, just to name one scenario.

I considered that, but why couldn't that be /usr/man/man3/system and
/usr/man/man3/system.f? Also, did they have the lettered subsections when
the naming convention was started?

--
Barry Margolin
System Manager, Thinking Machines Corp.

bar...@think.com {uunet,harvard}!think!barmar

-----------------------------

From: "Peter F. Couvares" <pfco...@unix.amherst.edu>
Subject: Re: Man page naming convention
Date: 9 Oct 92 03:43:29 GMT
To: info...@sem.brl.mil

bar...@think.com (Barry Margolin) writes:
> Why does the man command require the section number of the man page entry
> to be in the file name suffix, when it's already in the directory name?

I'm by no means a unix-guru, but in my experience setting up a
Linux system, the .2 or .1 helped indicate where a man page should be placed.
Although you could always look in the file itself, it's a lot easier to
type "mv *.2 /usr/man/man2" when you have a few dozen to sort. Just a guess...

-Peter

pfco...@unix.amherst.edu (Peter Couvares)

-----------------------------

From: Bill Campbell <bi...@celestial.com>
Subject: Re: Man page naming convention
Date: 10 Oct 92 02:16:05 GMT
To: info...@sem.brl.mil

In <1b24n7...@early-bird.think.com> bar...@think.com (Barry Margolin) writes:

:In article <1992Oct8.1...@news.eng.convex.com> tch...@convex.COM (Tom Christiansen) writes:
:>:Why does the man command require the section number of the man page entry
:>:to be in the file name suffix, when it's already in the directory name?

:>One reason is that people can have one man3 directory that contains
:>both system.3 (or 3c) and system.3f, just to name one scenario.

:I considered that, but why couldn't that be /usr/man/man3/system and
:/usr/man/man3/system.f? Also, did they have the lettered subsections when
:the naming convention was started?

The main reason I can see for using the .<number> suffix is that
I usually write all the man pages in a directory other than /usr/man...
and it helps to determine where to put them when I'm done.

Bill
--
INTERNET: bi...@Celestial.COM Bill Campbell; Celestial Software
UUCP: ...!thebes!camco!bill 6641 East Mercer Way
uunet!camco!bill Mercer Island, WA 98040; (206) 947-5591
SPEED COSTS MONEY -- HOW FAST DO YOU WANT TO GO?

-----------------------------

From: Stefan Monnier <osoelga...@cmu.edu>
Subject: Login shell
Date: 8 Oct 92 18:36:59 GMT
To: info...@sem.brl.mil


How can I know in .cshrc if csh has been started as a login shell ?

Stefan

-----------------------------------------------------
-- On the average, people seem to be acting normal --
-----------------------------------------------------

-----------------------------

From: "David K. Codelli" <cod...@cyclone.mitre.org>
Subject: Manipulating strings in batch file
Date: 8 Oct 92 19:25:31 GMT
Sender: News Service <ne...@linus.mitre.org>
Nntp-Posting-Host: cyclone.mitre.org
To: info...@sem.brl.mil

I am writing a batch file that runs awk on a file that has a name of the form:

prefix.input

I want to write the output to a file of the form

prefix.output

(Prefix is variable) How can I screen off the prefix in my batch file?

i.e.

#!/bin/sh
inputfilename=$1
outputfilname= <take output suffix and add "output">
awk ... > outputfilename

Thanks!

--
David K. Codelli The opinions stated here are mine
The MITRE Corporation only, and not necesssarily those
dcod...@mitre.org of my employer.

-----------------------------

From: John Ellithorpe <jd...@nefertiti.mit.edu>
Subject: Re: Manipulating strings in batch file
Date: 10 Oct 92 04:20:02 GMT
Sender: News system <ne...@athena.mit.edu>
Nntp-Posting-Host: nefertiti.mit.edu
To: info...@sem.brl.mil

On Thu, 8 Oct 1992 19:25:31 GMT, cod...@cyclone.mitre.org (David K. Codelli) said:
> Nntp-Posting-Host: cyclone.mitre.org

> I am writing a batch file that runs awk on a file that has a name of the form:
> prefix.input
> I want to write the output to a file of the form
> prefix.output
> (Prefix is variable) How can I screen off the prefix in my batch file?
> i.e.
> #!/bin/sh
> inputfilename=$1
> outputfilname= <take output suffix and add "output">
> awk ... > outputfilename

> Thanks!

If input and output are fixed, then you can just use the basename command:

#!/bin/sh
inputfilename=$1
outputfilename=`basename $1 .input`.output
awk ... > outputfilename

and that's it.

John
--

===============================================================================
John Ellithorpe | Internet: jd...@maggie.mit.edu
Dept. of Physics, Rm 26-349 | Phone : (617) 253-3074 Office
Massachusetts Institute of Technology | (617) 253-3072 Lab
Cambridge, MA 02139 | (617) 236-4910 Home
===============================================================================

-----------------------------

From: Brian Vetter <b...@shasta.tivoli.com>
Subject: Re: Multiple Users for Windows/NT
Date: 8 Oct 92 19:26:41 GMT
Sender: ne...@tivoli.uucp
Followup-To: comp.unix.dos-under-unix
To: info...@sem.brl.mil

Alistair Banks writes:

|> Both the microkernel and the Win32 subsystem know how to handle multile
|> users. The piece that won't is the server that managers the screen, being
|> a part of the Win32 subsystem. So you can have multiple background
|> tasks with different security IDs, but only one security ID for
|> interactive processes -- Alistair

Frankly, I don't know what you are getting at. I'm sitting here at my
Sparcstation (running SunOs of course) and I can "graphically" create new
windows and run programs from my window manager - BUT ONLY AS THE USER ID
I have logged in as. So Unix/X window managers don't provide such a facility
either. The special "trick" to run a "graphical" program as
another user is to create a shell/command window, su, and then crank up
the "windowing" program from there.

So are you suggesting that someone can't run a "shell" in a window (not
a dos shell) as an app, spawn another shell within that window with a
different user id (su or login equivalent), and then run other
"interactive" programs from that shell with that user id? Does the Win32
window "server" not allow this other "interactive" process to create
new windows because of a different security ID (no xhost-like mechanism)?

Brian Vetter
b...@tivoli.com

-----------------------------

From: Bob Myers <sts...@st.unocal.com>
Subject: Re: MIT X11R5 problem with SUID & SGID

Date: 8 Oct 92 21:37:46 GMT
Sender: Unocal USENET News <ne...@unocal.com>
To: info...@sem.brl.mil

In article <1992Oct6.2...@nmt.edu> ke...@nmt.edu (kelly) writes:

kelly> My next beef has to do with the `install' target and SUN-DES-1
kelly> authorization. The mit `install' target installs xterm as set-uid
kelly> root, so it can update the /etc/utmp file.

kelly> However, a program that runs set-uid root uses root's key on the local
kelly> machine rather your key, rendering SUN-DES-1 authorization only useful
kelly> for useless clients like xclock, xman, ... . You can't run xterms.

kelly> The fix: install xterm as set-gid tty, not set-uid root, and make sure
kelly> /etc/utmp is group-writable by group tty. Then, an xterm runs with
kelly> your user ID, so it uses your key for SUN-DES-1, and you've got the
kelly> protection you were after.

Hmmm. This doesn't do everything the suid bit did, though. A suid root
xterm will change the ownership of the tty to the appropriate user, preventing
other users from reading/writing there, etc. Your "fix" won't be able to do
this.

Maybe the way this should work is to use the SUN-DES-1 key for the real
uid, not the key for the effective uid. This is really a SUN-DES-1/suid
problem, not an install problem.

--
Bob Myers Unocal Science & Technology Division
Internet: Bob....@st.unocal.com Seismic Research and Applications
Phone: [714] 693-6951 P. O. Box 68076
Anaheim, California 92817-8076

-----------------------------

From: "yung-kao.hsu" <yk...@cbnewsf.cb.att.com>
Subject: changing control terminal
Date: 8 Oct 92 21:48:22 GMT
Sender: ne...@cbfsb.cb.att.com
To: info...@sem.brl.mil


We encounter the following problem and appreciate any information
in solving it. Here is the problem:

We have a group of processes who frequently open and close
terminal devices for external communications. Since control
terminal associated with each process is determined by the
first device it opened after setpgrp() call or it first
started (according to some UNIX documents), to make sure signal
handling won't get messed up, these process will call setpgrp()
each time they close and open a tty device (only one device is
opened at any time).

Despite that, we continue to see many of these processes
shared the same control terminal when we do a "ps" command.
The ingoblem seems to us is that using setpgrp() only allow
us to set the control terminal for ONCE; any subsequent
calls and device opening will not be able to affect this
in the same process.

I wonder if anyone encountered such a problem before and what
was the solution besides forking. I appreciate any responses.

Yung-Kao Hsu
PS: I am not a regular subscriber to this group; forgive me if it has been
frequently asked or this is the wrong group to post.

-----------------------------

From: Dusit Tansathein <d...@mdi.gwinnett.com>
Subject: NFS problem?
Date: 8 Oct 92 22:21:41 GMT
To: info...@sem.brl.mil

Hi,

I get the following message on the console of our NCR-3447 running UNIX SVR4.2:
"WARNING: dlpi.c: ILD: could not allocb DL_UNITDATA_IND". My questions are:

1) Does this have something to do with NFS (our NCR is the NFS server)?
2) Can it cause the system to hang?
3) If you experienced the same problem, what would be the best solution?

Any information would be appreciated.

Thanks,

Duke-The (scsi) Terminator, d...@mdi.gwinnett.com (Dusit Tansathein)

-----------------------------

From: Sean Coleman 497-5672 <col...@bldrdoc.gov>
Subject: Anyone can remove files
Date: 8 Oct 92 22:51:23 GMT
Sender: ne...@dove.nist.gov
Originator: coleman@deputy
To: info...@sem.brl.mil


If a directory has the permissions drwxrwxrwx and there
exists a file in the directory owned by user A with
permissions rw-------, why should anyone be allowed to

remove the file? Does the directory permissions have
precendence over file permissions? I would of thought
that eventhough the directory has write permissions for
the group and other, they still shouldn't be able to
remove the file since only the owner can read and write.

Thanks

Sean Coleman
col...@bldrdoc.gov

-----------------------------

From: Thomas Richard Stevenson <t...@uts.cc.wayne.edu>
Subject: Re: Anyone can remove files
Date: 9 Oct 92 03:16:03 GMT
To: info...@sem.brl.mil

col...@bldrdoc.gov (Sean Coleman 497-5672 ) writes:


>If a directory has the permissions drwxrwxrwx and there
>exists a file in the directory owned by user A with
>permissions rw-------, why should anyone be allowed to

>remove the file? Does the directory permissions have
>precendence over file permissions? I would of thought
>that eventhough the directory has write permissions for
>the group and other, they still shouldn't be able to
>remove the file since only the owner can read and write.

There are two different permissions here. The file permissions
control what a user can do with the data within the file. It
does NOT control what a user can do with the file it's self.

The dir permissions control what a user can do with the file. It
does NOT control what a user can do with the data within the file.

Between the two permissions, the complete file/data permission is
created. So if you want to permit a file Read/Write, you change
the access to the file. If you want to permit the file Create/Destroy,
you change the access to the directory the file is in.

Lets say you chown a file to someone else, and the access on the
file was 700. You would not be able to read or write the file.
You would not be able to change the owner back to you (or anyone
else). You would not be able to change the access to something
you did have access to, but if you still had R/W access to the
directory that file was in, you would be able to destroy it, because
destroy access has to do with the dir access, not the file access, or
file owner.

--
____ __ __ T...@UTS.CC.Wayne.Edu
/ /_/ /_ Thomas_Richa...@MTS.CC.Wayne.Edu
/. /\ . __/. T...@CMS.CC.Wayne.Edu
Use...@WayneMTS.Bitnet

-----------------------------

From: Thomas Koenig <ecm...@ccu1.aukuni.ac.nz>
Subject: Re: Anyone can remove files
Date: 9 Oct 92 21:44:48 GMT
To: info...@sem.brl.mil

col...@bldrdoc.gov (Sean Coleman 497-5672 ) writes:

>If a directory has the permissions drwxrwxrwx and there
>exists a file in the directory owned by user A with
>permissions rw-------, why should anyone be allowed to
>remove the file?

You can prevent that in SGI's IRIX, and quite a nice feature it is, too:

[from the rm(1) manpage]

If the directory containing the file to be removed has the 'sticky' bit
set (see chmod(2)) then in order to remove the file one of the following
must be true:

the user owns the file,
the user owns the directory,
the file is writable by the user, or
the user is the super-user.
--
Thomas Koenig, ecm...@ccu1.aukuni.ac.nz, ib...@rz.uni-karlsruhe.de
The joy of engineering is to find a straight line on a double logarithmic
diagram.

-----------------------------

From: Pat Chan <pc...@mdd.comm.mot.com>
Subject: Profiling on shared library..
Date: 8 Oct 92 23:35:15 GMT
Sender: ne...@mdd.comm.mot.com
To: info...@sem.brl.mil

I'm trying to do profiling (Sun profile) on my program.
The ld chokes when it's a shared library.

Any help is welcome.

pat chan

--
Pat Chan Internet: pc...@mdd.comm.mot.com
Motorola Mobile Data Division Voice: (604) 241-6032
11411 Number Five Road Fax: (604) 241-6042
Richmond, BC Canada V7A 4Z3

-----------------------------

From: Tim Thompson <t...@blink.att.com>
Subject: Re: Profiling on shared library..
Date: 10 Oct 92 02:04:52 GMT
Sender: NetNews Administrator <ne...@cbnewsh.cb.att.com>
Nntp-Posting-Host: wink.ho.att.com
To: info...@sem.brl.mil

bar...@think.com (Barry Margolin) writes:

>In article <tjt.718655662@sparc-10> t...@blink.att.com (Tim Thompson) writes:
>>Can you use -Bstatic when compiling a program that uses -ldl ?

>No. libdl.so.* is actually a dummy routine, and the dlopen(), et al ...


>However, it's possible to have a mixture of dynamic and static linking in a
>program, so you may be able to do this by only linking libdl dynamically.

I tried to do that (by putting -Bstatic and -Bdynamic at various points
in the command line) but never succeeded. I'm suspecting that both
dynamic loading and profiling want to insert hooks into the startup
mechanism, and that those hooks can't co-exist. Just a guess, though.

Inserting the profiling hooks manually would probably work. If at some
point I get tired of hacking a staticly-linked version of my program, I'll
probably try that. ...Tim...tjt@blink.att.com...

-----------------------------

From: Mike Digdon <dig...@ug.cs.dal.ca>
Subject: Sockets and stuff
Date: 9 Oct 92 02:46:00 GMT
Sender: USENET News <use...@cs.dal.ca>
Nntp-Posting-Host: ug.cs.dal.ca
To: info...@sem.brl.mil


I am working on a project that involves a daemon, and obviously, I will be
using sockets for all of the communications. After looking thru various FAQ's
and stuff, I just can't seem to find what I am looking for..

I know how to set up a socket and talk with it.. however, my problem is
waiting for a connection and multiple users..

If a connection has not been made, I want my program (the daemon) to run
some other stuff, since more than one user will be able to access it at
a time. I am led to believe that accept sits and waits for a connection
of some sort and doesn't do anything else until a connection is made.
Am I incorrect in this assumption? If this is the case, how would I check
to see if a connection is being made, and if not, continue running other
parts of my program to take care of the users who are already connected.

And where might I find some stuff on the net that talks about sockets and
daemons and the like? I have a few books here, but they don't say much..
at least not what I need..

--
Mike Digdon - Vice Prez DSCSS - Dalhousie University
dig...@ug.cs.dal.ca -- Halifax, NS
- Real programmers never work nine to five -

-----------------------------

From: Brad Bobak <bbo...@undergrad.math.uwaterloo.ca>
Subject: Re: Sockets and stuff

Date: 9 Oct 92 12:55:11 GMT
Sender: Operator <ro...@undergrad.math.waterloo.edu>
To: info...@sem.brl.mil

In article <Bvu2C...@cs.dal.ca> you write:
>
>I am working on a project that involves a daemon, and obviously, I will be
>using sockets for all of the communications. After looking thru various FAQ's
>and stuff, I just can't seem to find what I am looking for..
>
>I know how to set up a socket and talk with it.. however, my problem is
>waiting for a connection and multiple users..
>
>If a connection has not been made, I want my program (the daemon) to run
>some other stuff, since more than one user will be able to access it at
>a time. I am led to believe that accept sits and waits for a connection
>of some sort and doesn't do anything else until a connection is made.
>Am I incorrect in this assumption?

More or less, yes. (see below)

>If this is the case, how would I check
>to see if a connection is being made, and if not, continue running other
>parts of my program to take care of the users who are already connected.

If you have the select() call on your system, you can use that. eg:

fd_set fds;
struct timeval tv;

tv.tv_sec = 1; /* spend max. 1 second checking for new connections */
tv.tv_usec = 0;

FD_ZERO(&fds);
FD_SET(your_socket, &fds);

/* actually, if your only checking your socket, you can set MAXFDS to
* your sockets descriptor number + 1
*/
select(MAXFDS/*NOFILE in /sys/param.h*/, &fds, (fd_set *)0, (fd_set *)0, &tv);
/* don't forget to do error checking for select */
if (FD_ISSET(your_socked, &fds))
{
/* something is ready on the socket */
accept(...);
}
else
{
/* do your stuff */
}

if you don't have select, or want to do this another way:

make your socket non-blocking, one way is to use O_NDELAY:

fcntl(your_socket, F_SETFL, O_NDELAY);
/* error checking.. */

then do an accept:

res = accept(...);
if (res == -1 && errno == EWOULDBLOCK)
{
/* no new connection */
}

>
>And where might I find some stuff on the net that talks about sockets and
>daemons and the like? I have a few books here, but they don't say much..
>at least not what I need..

Use archie to find '07.ipctut' and '08.ipc' they're mainly just
examples on how to do interprocess communication, but they'll more
than likely help you out.

>--
> Mike Digdon - Vice Prez DSCSS - Dalhousie University
> dig...@ug.cs.dal.ca -- Halifax, NS
> - Real programmers never work nine to five -

-----------------------------

From: "Georg S. Nikodym" <geo...@noweh.com>
Subject: Re: Solbourne blues, in Boot minor
Keywords: boot solbourne
Date: 9 Oct 92 04:39:59 GMT
To: info...@sem.brl.mil

In article <28...@nlsun1.oracle.nl> rl...@nl.oracle.com (The Wizard of Ozje - Garf) writes:
>Folks,
>
>I have inadvertently inserted an error in the bsh /etc/rc.boot script on my
>Solbourne portable Sun (Sparc inside). Anybody any ideas about how I can fix
>the error short of reinstalling the whole thing again? It boots into a bsh with
># prompt ofcourse, but there's nothing mounted so I can't run anything. All the other rc scripts fall flat on their faces. The root FS is mounted read-only,
>so I can't just stomp over it with echo in the shell.

Try booting with a "boot -s" command. This will boot in single user and
hopefully not run any of the rc.* scripts.

Hope that helps...

--
Georg S. Nikodym - (416) 272-5198 / 720-4729
Noweh Software - Mississauga, Ontario, CANADA
UUCP: {comspec.com, lsuc.on.ca, uunet.ca}!noweh!georgn
RFC822: geo...@noweh.COM

-----------------------------

From: "Georg S. Nikodym" <geo...@noweh.com>
Subject: Re: comminicating with devices
Date: 9 Oct 92 04:53:22 GMT
To: info...@sem.brl.mil

In article <1992Oct4.0...@menudo.uh.edu> cav...@menudo.uh.edu (Chris M. Cavers) writes:
>I would like to get some hints on what is the best way to
>communicate with a device driver.

Open it ;-)

>Specifically, I have written a disk device driver.
>I would like to have a user level process communicate with
>the device and the device with the user level process.
>I would like to use message queues but am unsure of the effects
>of crossing the kernel/user boundary. The main concern is
>that the device should wake up whenever a message arrives and the message
>handling should not interfere with the normal device operations of
>the disk device driver...

It might be helpful to know what you want to do and why, since the way
you've presented your question makes me say, "Huh?!?"

Anyway, you should be aware that message queues are an IPC (Inter-Process
Communication) service provided by the kernel for user-level processes.
In short, this probably isn't what you want.

One way to achieve process to driver communication is via the ioctl(2)
mechanism. Ie, you add support for various ioctl() calls to your driver
that would perform some useful function.

There isn't really any way for a driver to signal user level processes if
nobody's paying attention.

Another option might be to implement your driver as a STREAMS driver
(which probably isn't a good idea in the case of disks) and then you
might be able to create a STREAMS module that could effect the stuff
you want.

Sorry I can't be more complete, but lacking a good definition of your
problem/needs all I can do is supply information based on my assumptions
of your goals.

--
Georg S. Nikodym - (416) 272-5198 / 720-4729
Noweh Software - Mississauga, Ontario, CANADA
UUCP: {comspec.com, lsuc.on.ca, uunet.ca}!noweh!georgn
RFC822: geo...@noweh.COM

-----------------------------

From: Ted Timar <tmat...@sunee.uwaterloo.ca>
Subject: Welcome to comp.unix.questions [Monthly posting]
Date: 9 Oct 92 05:00:57 GMT
Expires: Fri, 6 Nov 1992 05:00:14 GMT
Sender: News system <ne...@athena.mit.edu>
Followup-To: comp.unix.questions
Approved: news-answe...@MIT.Edu
Supersedes: <unix-faq/unix-intro...@athena.mit.edu>
X-Last-Updated: 1992/09/24
Nntp-Posting-Host: pit-manager.mit.edu
To: info...@sem.brl.mil

Archive-name: unix-faq/unix-intro
Version: $Id: unix-intro,v 1.6 92/09/11 09:16:40 tmatimar Exp $

Comp.unix.questions is one of the most popular and highest volume
newsgroups on Usenet. This article is a monthly attempt to remind
potential posters about what is appropriate for this newsgroup.
If you would like to make any suggestions about the content of
this article, please contact its maintainer at
tmat...@sunee.uwaterloo.ca.

Companion articles include the answers to some Frequently
Asked Questions. You may save yourself a lot of time by reading
those articles before posting a question to the net.

If you have not already read the overall Usenet introductory material
posted to "news.announce.newusers", please do. Much of this article
overlaps with the common sense guidelines posted there.

Should I Post My Unix Question to the Net?

Often the answer is "No, you can get an answer a lot faster without
posting a question." Before you post, you should try -

o Reading the manual for your system. Some day you may encounter
the phrase "RTFM", which stands for "Read the Fine Manual"
(except 'F' doesn't really stand for "Fine"). If you ask
someone a question and they tell you to RTFM, it's an
indication that you haven't done your homework. For instance,
if you are having trouble removing a file whose name begins
with a "-", check the man page for "rm". It might tell
you what you need to know.

When people use terminology like "read(2)", they are referring
to the "read" man page in section 2 of the manual (which you
would see by using "man 2 read").

o Finding a knowledgeable user at your site. Many sites have
at least a few Unix experts who will be happy to help you
figure out how to remove a file whose name begins with "-".
Many larger sites, particularly universities, may even have
paid consultants whose job is to help you with Unix problems.
Check with them first.

o Find a good introductory book on Unix. There are plenty of
such books available, and you will save yourself a lot
of trouble by having one handy and consulting it frequently.
(Question 1.5 in the companion articles will let you know
where you can find a list of good Unix and C books.)

Please remember that the comp.unix.* newsgroups are read by over 80,000
people around the world, and that posting a question to this group will
cost a lot of time and money by the time your article is distributed to
Asia, Australia, Europe (west and east), Africa, the middle east,
and all corners of North, South and Central America.

Also, some people receive these newsgroups as part of a mailing list
rather than a newsgroup. If you're one of these people, please don't
send a "Remove me from this list" or "UNSUBSCRIBE" message to the
wrong place. Take the time to figure out where you're getting this
stuff from, and send your request to the mailing list maintainer, *not*
to the list or newsgroup itself! Ask your local postmaster for help.
(One of the answers in the companion articles deals with the details of
the mailing list.)

To Which Newsgroup Should I Post My Question?

The choice of newsgroup is harder than it used to be. In the old days,
you just had to choose between "comp.unix.questions" and
"comp.unix.wizards". Now there are a variety of more specific groups.
Choose one of the following groups carefully. If you aren't sure where
your question belongs or if your question is not specific to some
particular version of Unix, try "comp.unix.questions". Many
knowledgeable Unix wizards read that group and will be able to help you.

Here are the capsule descriptions of various groups you might consider
(extracted from a monthly posting to "news.announce.newusers")

comp.unix.questions General questions from UNIX users and sys admins.
If your question isn't a really good match for one of
the groups below, post it here.

news.answers Repository for periodic USENET articles. (Moderated)
This article is crossposted there.
Do not try to post here unless you're
posting a list of FAQ's and their answers.

comp.unix.shell Using and programming any UNIX shell.

comp.lang.c Discussion about C.

comp.sources.unix Postings of complete, UNIX-oriented sources. (Moderated)
comp.std.unix Discussion for the P1003 committee on UNIX. (Moderated)
comp.unix Discussion of UNIX* features and bugs. (Moderated)
comp.unix.admin Administering a Unix-based system.
comp.unix.aix IBM's version of UNIX.
comp.unix.amiga Unix on the Commodore Amiga
comp.unix.aux The version of UNIX for Apple Macintosh II computers.
comp.unix.bsd Discussions relating to BSD UNIX.
comp.unix.internals Discussions on hacking UNIX internals.
comp.unix.large UNIX on mainframes and in large networks.
comp.unix.misc Various topics that don't fit other groups.
comp.unix.msdos MS-DOS running under UNIX by whatever means.
comp.unix.programmer Q&A for people programming under Unix.
comp.unix.sysv286 UNIX System V (not XENIX) on the '286.
comp.unix.sysv386 Versions of Unix (not Xenix) on Intel 80386-based boxes.
comp.unix.ultrix Discussions about DEC's Ultrix.
comp.unix.xenix.misc General discussions regarding XENIX (except SCO).
comp.unix.xenix.sco XENIX versions from the Santa Cruz Operation.

comp.unix.wizards In-depth discussions of advanced unix topics.
People should not post to this group unless they
have used unix as a user, sysadmin and know details
of the kernel, and how different unix kernels differ.
In other words, don't post to comp.unix.wizards.

What Information Should I Include?

It's hard to include too much information. There are hundreds of
different Unix systems out there, and they all have less in common
than you might think. If you have a problem and are posting an
article, please be sure to mention:

o A descriptive subject line. Many people will decide whether
to read your article solely on the basis of the subject line,
so it should be a good statement of your problem.

NOT GOOD GOOD

"Help" "How do I sort a file by line length?"
"Csh question" "csh dumps core when I use '$<'"

o What computer you are using, and what specific version
of the operating system it uses. For instance,

SunOS 4.0.1, Sun 3/50
4.3BSD-tahoe, Vax 11/780
SVR3.2, 3b2

o If possible, the *exact* text of any error message you
may have encountered.

WRONG RIGHT

"I can't print this file" "When I type 'lpr Filename', I get
lpr: Filename: File too ugly to print
What does this mean? It isn't in
the man page. This is using
Mueslix 9.3 on a Fax 68086502"

It's a good idea to post unrelated questions in separate articles,
so that people can keep different discussions separate. It's also
a *very* good idea to include a line or two like this:

"Please mail your answers to me and I'll summarize what I get
and post the results to comp.unix.questions."

This prevents many identical responses from different users to the
same question from clogging up the newsgroup. And make sure
you really summarize what you get - don't just concatenate
all the mail you've received.

It's also a good idea to read comp.unix.questions for at least a couple
of weeks after you post your article to see what followup articles
are posted.

Should I Post an Answer to a Question?

It's very tempting to post an answer to a question you read on the net,
especially when you think "Aha, finally - a question I can answer!"
Consider though that when a simple question is asked, such as the
sort about to be answered below, many other people around the
world already know the answer and may be posting their own reply.
In order to avoid dozens of replies to simple questions, please
wait a day or so and see if anyone else has already answered
the question. If you have something special to contribute, please
do so, but make sure you're not duplicating something someone else has
already done.

You should feel free to reply to any question >by email<. Even if
the user gets 200 responses to his question, at least the load on the
rest of the net is minimized.

What About Posting Source Code?

Posting small amounts of example code is fine (use comp.sources.unix to
distribute complete programs) - but please make sure that your code
runs (or at least compiles) properly. Don't just type it in while
editing your posting and hope it will work, no matter how sure you are
that it will. We all make mistakes.

What About Those People
Who Continue to Ask Stupid or Frequently Asked Questions
In Spite of The Frequently Asked Questions Document?

Just send them a polite mail message, possibly referring them to this document.
There is no need to flame them on the net - it's busy enough as it is.
--
Ted Timar - tmat...@sunee.uwaterloo.ca
Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3

-----------------------------

From: Ted Timar <tmat...@sunee.uwaterloo.ca>
Subject: Frequently Asked Questions about Unix (index) [Monthly posting]
Date: 9 Oct 92 05:02:01 GMT
Expires: Fri, 6 Nov 1992 05:00:14 GMT
Sender: News system <ne...@athena.mit.edu>
Followup-To: comp.unix.questions
Approved: news-answe...@MIT.Edu
Supersedes: <unix-faq/contents_...@athena.mit.edu>
X-Last-Updated: 1992/09/24
Nntp-Posting-Host: pit-manager.mit.edu
To: info...@sem.brl.mil

Archive-name: unix-faq/contents
Version: $Id: contents,v 1.6 92/09/11 09:46:37 tmatimar Exp $

The following four articles contain the answers to some Frequently Asked
Questions often seen in comp.unix.questions and comp.unix.shell.
Please don't ask these questions again, they've been answered plenty
of times already - and please don't flame someone just because they may
not have read this particular posting. Thank you.

These articles are divided approximately as follows:

1.*) General questions.
2.*) Relatively basic questions, likely to be asked by beginners.
3.*) Intermediate questions.
4.*) Advanced questions, likely to be asked by people who thought
they already knew all of the answers.

The following questions are answered:

1.1) Who helped you put this list together?
1.2) When someone refers to 'rn(1)' or 'ctime(3)', what does
the number in parentheses mean?
1.3) What does {some strange unix command name} stand for?
1.4) How does the gateway between "comp.unix.questions" and the
"info-unix" mailing list work?
1.5) What are some useful Unix or C books?
1.6) What happened to the pronunciation list that used to be
part of this document?

2.1) How do I remove a file whose name begins with a "-" ?
2.2) How do I remove a file with funny characters in the filename ?
2.3) How do I get a recursive directory listing?
2.4) How do I get the current directory into my prompt?
2.5) How do I read characters from the terminal in a shell script?
2.6) How do I rename "*.foo" to "*.bar", or change file names
to lowercase?
2.7) Why do I get [some strange error message] when I
"rsh host command" ?
2.8) How do I {set an environment variable, change directory} inside a
program or shell script and have that change affect my
current shell?
2.9) How do I redirect stdout and stderr separately in csh?
2.10) How do I tell inside .cshrc if I'm a login shell?
2.11) How do I construct a shell glob-pattern that matches all files
except "." and ".." ?
2.12) How do I find the last argument in a Bourne shell script?
2.13) What's wrong with having '.' in your $PATH ?

3.1) How do I find out the creation time of a file?
3.2) How do I use "rsh" without having the rsh hang around
until the remote command has completed?
3.3) How do I truncate a file?
3.4) Why doesn't find's "{}" symbol do what I want?
3.5) How do I set the permissions on a symbolic link?
3.6) How do I "undelete" a file?
3.7) How can a process detect if it's running in the background?
3.8) Why doesn't redirecting a loop work as intended? (Bourne shell)
3.9) How do I run 'passwd', 'ftp', 'telnet', 'tip' and other interactive
programs from a shell script or in the background?
3.10) How do I find out the process ID of a program with a particular
name from inside a shell script or C program?
3.11) How do I check the exit status of a remote command
executed via "rsh" ?
3.12) Is it possible to pass shell variable settings into an awk program?
3.13) How do I get rid of zombie processes that persevere?
3.14) How do I get lines from a pipe as they are written instead of
only in larger blocks.

4.1) How do I read characters from a terminal without requiring the user
to hit RETURN?
4.2) How do I check to see if there are characters to be read without
actually reading?
4.3) How do I find the name of an open file?
4.4) How can an executing program determine its own pathname?
4.5) How do I use popen() to open a process for reading AND writing?
4.6) How do I sleep() in a C program for less than one second?
4.7) How can I get setuid shell scripts to work?
4.8) How can I find out which user or process has a file open or is using
a particular file system (so that I can unmount it?)
4.9) How do I keep track of people who are fingering me?
4.10) Is it possible to reconnect a process to a terminal after it has
been disconnected, e.g. after starting a program in the background
and logging out?
4.11) Is it possible to "spy" on a terminal, displaying the output
that's appearing on it on another terminal?

If you're looking for the answer to, say, question 1.5, look in
part 1 and search for the regular expression "^1.5)".

While these are all legitimate questions, they seem to crop up in
comp.unix.questions on an annual basis, usually followed by plenty
of replies (only some of which are correct) and then a period of
griping about how the same questions keep coming up. You may also like
to read the monthly article "Answers to Frequently Asked Questions"
in the newsgroup "news.announce.newusers", which will tell you what
"UNIX" stands for.

With the variety of Unix systems in the world, it's hard to guarantee
that these answers will work everywhere. Read your local manual pages
before trying anything suggested here. If you have suggestions or
corrections for any of these answers, please send them to to
tmat...@sunee.uwaterloo.ca.

-----------------------------

From: Ted Timar <tmat...@sunee.uwaterloo.ca>
Subject: Frequently Asked Questions about Unix (1/4) [Monthly posting]
Date: 9 Oct 92 05:02:32 GMT
Expires: Fri, 6 Nov 1992 05:00:14 GMT
Sender: News system <ne...@athena.mit.edu>
Followup-To: comp.unix.questions
Approved: news-answe...@MIT.Edu
Supersedes: <unix-faq/part1_7...@athena.mit.edu>
X-Last-Updated: 1992/09/24
Nntp-Posting-Host: pit-manager.mit.edu
To: info...@sem.brl.mil

Archive-name: unix-faq/part1
Version: $Id: part1,v 1.6 92/09/11 09:40:39 tmatimar Exp $

These four articles contain the answers to some Frequently Asked
Questions often seen in comp.unix.questions and comp.unix.shell.
Please don't ask these questions again, they've been answered plenty
of times already - and please don't flame someone just because they may
not have read this particular posting. Thank you.

These articles are divided approximately as follows:

1.*) General questions.
2.*) Relatively basic questions, likely to be asked by beginners.
3.*) Intermediate questions.
4.*) Advanced questions, likely to be asked by people who thought
they already knew all of the answers.

This article includes answers to:

1.1) Who helped you put this list together?
1.2) When someone refers to 'rn(1)' or 'ctime(3)', what does
the number in parentheses mean?
1.3) What does {some strange unix command name} stand for?
1.4) How does the gateway between "comp.unix.questions" and the
"info-unix" mailing list work?
1.5) What are some useful Unix or C books?
1.6) What happened to the pronunciation list that used to be
part of this document?

If you're looking for the answer to, say, question 1.5, and want to skip
everything else, you can search ahead for the regular expression "^1.5)".

While these are all legitimate questions, they seem to crop up in
comp.unix.questions on an annual basis, usually followed by plenty
of replies (only some of which are correct) and then a period of
griping about how the same questions keep coming up. You may also like
to read the monthly article "Answers to Frequently Asked Questions"
in the newsgroup "news.announce.newusers", which will tell you what
"UNIX" stands for.

With the variety of Unix systems in the world, it's hard to guarantee
that these answers will work everywhere. Read your local manual pages
before trying anything suggested here. If you have suggestions or
corrections for any of these answers, please send them to to
tmat...@sunee.uwaterloo.ca.

1.1) Who helped you put this list together?

I took over the maintenance of this list. Almost all of the work
(and the credit) for generating this compilation was done by
Steve Hayman.

We also owe a great deal of thanks to dozens of Usenet readers who
submitted questions, answers, corrections and suggestions for this
list. Special thanks go to Maarten Litmaath, Guy Harris and
Jonathan Kamens, who have all made many especially valuable
contributions.

1.2) When someone refers to 'rn(1)' or 'ctime(3)', what does
the number in parentheses mean?

It looks like some sort of function call, but it isn't. These
numbers refer to the section of the "Unix manual" where the
appropriate documentation can be found. You could type "man 3
ctime" to look up the manual page for "ctime" in section 3 of
the manual.

The traditional manual sections are:

1 User-level commands
2 System calls
3 Library functions
4 Devices and device drivers
5 File formats
6 Games
7 Various miscellaneous stuff - macro packages etc.
8 System maintenance and operation commands

Some Unix versions use non-numeric section names. For instance,
Xenix uses "C" for commands and "S" for functions.

Each section has an introduction, which you can read with "man #
intro" where # is the section number.

Sometimes the number is necessary to differentiate between a
command and a library routine or system call of the same name.
For instance, your system may have "time(1)", a manual page about
the 'time' command for timing programs, and also "time(3)", a
manual page about the 'time' subroutine for determining the
current time. You can use "man 1 time" or "man 3 time" to
specify which "time" man page you're interested in.

You'll often find other sections for local programs or even
subsections of the sections above - Ultrix has sections 3m, 3n,
3x and 3yp among others.

1.3) What does {some strange unix command name} stand for?

awk = "Aho Weinberger and Kernighan"

This language was named by its authors, Al Aho, Peter
Weinberger and Brian Kernighan.

grep = "Global Regular Expression Print"

grep comes from the ed command to print all lines matching a
certain pattern

g/re/p

where "re" is a "regular expression".

fgrep = "Fixed GREP".

fgrep searches for fixed strings only. The "f" does not stand
for "fast" - in fact, "fgrep foobar *.c" is usually slower than
"egrep foobar *.c" (Yes, this is kind of surprising. Try it.)

Fgrep still has its uses though, and may be useful when searching
a file for a larger number of strings than egrep can handle.

egrep = "Extended GREP"

egrep uses fancier regular expressions than grep. Many people
use egrep all the time, since it has some more sophisticated
internal algorithms than grep or fgrep, and is usually the
fastest of the three programs.

cat = "CATenate"

catenate is an obscure word meaning "to connect in a series",
which is what the "cat" command does to one or more files. Not
to be confused with C/A/T, the Computer Aided Typesetter.

gecos = "General Electric Comprehensive Operating System"

When GE's large systems division was sold to Honeywell,
Honeywell dropped the "E" from "GECOS".

Unix's password file has a "pw_gecos" field. The name is a
real holdover from the early days. Dennis Ritchie has reported:

"Sometimes we sent printer output or batch jobs
to the GCOS machine. The gcos field in the password file
was a place to stash the information for the $IDENT card.
Not elegant."

nroff = "New ROFF"
troff = "Typesetter new ROFF"

These are descendants of "roff", which was a re-implementation
of the Multics "runoff" program (a program that you'd use to
"run off" a good copy of a document).

tee = T

From plumbing terminology for a T-shaped pipe splitter.

bss = "Block Started by Symbol"

Dennis Ritchie says:

Actually the acronym (in the sense we took it up; it may
have other credible etymologies) is "Block Started by
Symbol." It was a pseudo-op in FAP (Fortran Assembly [-er?]
Program), an assembler for the IBM 704-709-7090-7094
machines. It defined its label and set aside space for a
given number of words. There was another pseudo-op, BES,
"Block Ended by Symbol" that did the same except that the
label was defined by the last assigned word + 1. (On these
machines Fortran arrays were stored backwards in storage
and were 1-origin.)

The usage is reasonably appropriate, because just as with
standard Unix loaders, the space assigned didn't have to be
punched literally into the object deck but was represented
by a count somewhere.

biff = "BIFF"

This command, which turns on asynchronous mail notification,
was actually named after a dog at Berkeley.

I can confirm the origin of biff, if you're interested.
Biff was Heidi Stettner's dog, back when Heidi (and I, and
Bill Joy) were all grad students at U.C. Berkeley and the
early versions of BSD were being developed. Biff was
popular among the residents of Evans Hall, and was known
for barking at the mailman, hence the name of the command.

Confirmation courtesy of Eric Cooper, Carnegie Mellon University

rc (as in ".cshrc" or "/etc/rc") = "RunCom"

"rc" derives from "runcom", from the MIT CTSS system, ca. 1965.

'There was a facility that would execute a bunch of
commands stored in a file; it was called "runcom" for "run
commands", and the file began to be called "a runcom."

"rc" in Unix is a fossil from that usage.'

Brian Kernighan & Dennis Ritchie, as told to Vicki Brown

"rc" is also the name of the shell from the new Plan 9
operating system.

Perl = "Practical Extraction and Report Language"

The Perl language is Larry Wall's highly popular
freely-available completely portable text, process, and file
manipulation tool that bridges the gap between shell and C
programming (or between doing it on the command line and
pulling your hair out). For further information, see the
Usenet newsgroup comp.lang.perl.

Don Libes' book "Life with Unix" contains lots more of these
tidbits.

1.4) How does the gateway between "comp.unix.questions" and the
"info-unix" mailing list work?

"Info-Unix" and "Unix-Wizards" are mailing list versions of
comp.unix.questions and comp.unix.wizards respectively.
There should be no difference in content between the
mailing list and the newsgroup.

To get on or off either of these lists, send mail to
Info-Uni...@brl.mil or Unix-Wizar...@brl.mil .
Be sure to use the '-Request'. Don't expect an immediate response.

Here are the gory details, courtesy of the list's maintainer,
Bob Reschly.

==== postings to info-UNIX and UNIX-wizards lists ====

Anything submitted to the list is posted; I do not moderate
incoming traffic -- BRL functions as a reflector. Postings
submitted by Internet subscribers should be addressed to the list
address (info-UNIX or UNIX- wizards); the '-request' addresses
are for correspondence with the list maintainer [me]. Postings
submitted by USENET readers should be addressed to the
appropriate news group (comp.unix.questions or
comp.unix.wizards).

For Internet subscribers, received traffic will be of two types;
individual messages, and digests. Traffic which comes to BRL
from the Internet and BITNET (via the BITNET-Internet gateway) is
immediately resent to all addressees on the mailing list.
Traffic originating on USENET is gathered up into digests which
are sent to all list members daily.

BITNET traffic is much like Internet traffic. The main
difference is that I maintain only one address for traffic
destined to all BITNET subscribers. That address points to a list
exploder which then sends copies to individual BITNET
subscribers. This way only one copy of a given message has to
cross the BITNET-Internet gateway in either direction.

USENET subscribers see only individual messages. All messages
originating on the Internet side are forwarded to our USENET
machine. They are then posted to the appropriate newsgroup.
Unfortunately, for gatewayed messages, the sender becomes
"news@brl-adm". This is currently an unavoidable side-effect of
the software which performs the gateway function.

As for readership, USENET has an extremely large readership - I
would guess several thousand hosts and tens of thousands of
readers. The master list maintained here at BRL runs about two
hundred fifty entries with roughly ten percent of those being
local redistribution lists. I don't have a good feel for the
size of the BITNET redistribution, but I would guess it is
roughly the same size and composition as the master list.
Traffic runs 150K to 400K bytes per list per week on average.

1.5) What are some useful Unix or C books?

Mitch Wright (mi...@cirrus.com) maintains a useful list of Unix
and C books, with descriptions and some mini-reviews. There are
currently 77 titles on his list.

You can obtain a copy of this list by anonymous ftp from
ftp.wg.omron.co.jp (133.210.4.4), where it's
"pub/unix-faq/Unix-C-Booklist". If you can't use anonymous ftp,
email the line "help" to "mail...@iuvax.cs.indiana.edu" for
instructions on retrieving things via email.

Send additions or suggestions to mi...@cirrus.com.

1.6) What happened to the pronunciation list that used to be part of this
document?

From its inception in 1989, this FAQ document included a
comprehensive pronunciation list maintained by Maarten Litmaath
(thanks, Maarten!). (Does anyone know who *created* it?)

It has been retired, since it is not really relevant to the topic
of "Unix questions". You can still find it as part of the
widely-distributed "Jargon" file (maintained by Eric S. Raymond,
er...@snark.thyrsus.com) which seems like a much more appropriate
forum for the topic of "How do you pronounce /* ?"

If you'd like a copy, you can ftp one from ftp.wg.omron.co.jp
(133.210.4.4), it's "pub/unix-faq/Pronunciation-Guide".

--
Ted Timar - tmat...@sunee.uwaterloo.ca
Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3

-----------------------------

From: Ted Timar <tmat...@sunee.uwaterloo.ca>
Subject: Frequently Asked Questions about Unix (2/4) [Monthly posting]
Date: 9 Oct 92 05:02:55 GMT

Expires: Fri, 6 Nov 1992 05:00:14 GMT
Sender: News system <ne...@athena.mit.edu>
Followup-To: comp.unix.questions
Approved: news-answe...@MIT.Edu
Supersedes: <unix-faq/part2_7...@athena.mit.edu>
X-Last-Updated: 1992/09/24
Nntp-Posting-Host: pit-manager.mit.edu
To: info...@sem.brl.mil

Archive-name: unix-faq/part2
Version: $Id: part2,v 1.6 92/09/11 09:15:29 tmatimar Exp $

These four articles contain the answers to some Frequently Asked
Questions often seen in comp.unix.questions and comp.unix.shell.
Please don't ask these questions again, they've been answered plenty
of times already - and please don't flame someone just because they may
not have read this particular posting. Thank you.

These articles are divided approximately as follows:

1.*) General questions.
2.*) Relatively basic questions, likely to be asked by beginners.
3.*) Intermediate questions.
4.*) Advanced questions, likely to be asked by people who thought
they already knew all of the answers.

This article includes answers to:

2.1) How do I remove a file whose name begins with a "-" ?
2.2) How do I remove a file with funny characters in the filename ?
2.3) How do I get a recursive directory listing?
2.4) How do I get the current directory into my prompt?
2.5) How do I read characters from the terminal in a shell script?
2.6) How do I rename "*.foo" to "*.bar", or change file names
to lowercase?
2.7) Why do I get [some strange error message] when I
"rsh host command" ?
2.8) How do I {set an environment variable, change directory} inside a
program or shell script and have that change affect my
current shell?
2.9) How do I redirect stdout and stderr separately in csh?
2.10) How do I tell inside .cshrc if I'm a login shell?
2.11) How do I construct a shell glob-pattern that matches all files
except "." and ".." ?
2.12) How do I find the last argument in a Bourne shell script?
2.13) What's wrong with having '.' in your $PATH ?

If you're looking for the answer to, say, question 2.5, and want to skip
everything else, you can search ahead for the regular expression "^2.5)".

While these are all legitimate questions, they seem to crop up in
comp.unix.questions on an annual basis, usually followed by plenty
of replies (only some of which are correct) and then a period of
griping about how the same questions keep coming up. You may also like
to read the monthly article "Answers to Frequently Asked Questions"
in the newsgroup "news.announce.newusers", which will tell you what
"UNIX" stands for.

With the variety of Unix systems in the world, it's hard to guarantee
that these answers will work everywhere. Read your local manual pages
before trying anything suggested here. If you have suggestions or
corrections for any of these answers, please send them to to
tmat...@sunee.uwaterloo.ca.

2.1) How do I remove a file whose name begins with a "-" ?

Figure out some way to name the file so that it doesn't begin
with a dash. The simplest answer is to use

rm ./-filename

(assuming "-filename" is in the current directory, of course.)
This method of avoiding the interpretation of the "-" works with
other commands too.

Many commands, particularly those that have been written to use
the "getopt(3)" argument parsing routine, accept a "--" argument
which means "this is the last option, anything after this is not
an option", so your version of rm might handle "rm -- -filename".
Some versions of rm that don't use getopt() treat a single "-"
in the same way, so you can also try "rm - -filename".

2.2) How do I remove a file with funny characters in the filename ?

If the 'funny character' is a '/', skip to the last part of this
answer. If the funny character is something else, such as a ' '
or control character or character with the 8th bit set, keep reading.

The classic answers are

rm -i some*pattern*that*matches*only*the*file*you*want

which asks you whether you want to remove each file matching
the indicated pattern; depending on your shell, this may not
work if the filename has a character with the 8th bit set (the
shell may strip that off);

and

rm -ri .

which asks you whether to remove each file in the directory.
Answer "y" to the problem file and "n" to everything else.
Unfortunately this doesn't work with many versions of rm. Also
unfortunately, this will walk through every subdirectory of ".",
so you might want to "chmod a-x" those directories temporarily
to make them unsearchable.

Always take a deep breath and think about what you're doing and
double check what you typed when you use rm's "-r" flag or a
wildcard on the command line;

and

find . -type f ... -ok rm '{}' \;

where "..." is a group of predicates that uniquely identify the
file. One possibility is to figure out the inode number of the
problem file (use "ls -i .") and then use

find . -inum 12345 -ok rm '{}' \;

or
find . -inum 12345 -ok mv '{}' new-file-name \;

"-ok" is a safety check - it will prompt you for confirmation of
the command it's about to execute. You can use "-exec" instead
to avoid the prompting, if you want to live dangerously, or if
you suspect that the filename may contain a funny character
sequence that will mess up your screen when printed.

What if the filename has a '/' in it?

These files really are special cases, and can only be created by
buggy kernel code (typically by implementations of NFS that don't
filter out illegal characters in file names from remote
machines.) The first thing to do is to try to understand exactly
why this problem is so strange.

Recall that Unix directories are simply pairs of filenames and
inode numbers. A directory essentially contains information
like this:

filename inode

file1 12345
file2.c 12349
file3 12347

Theoretically, '/' and '\0' are the only two characters that
cannot appear in a filename - '/' because it's used to separate
directories and files, and '\0' because it terminates a filename.

Unfortunately some implementations of NFS will blithely create
filenames with embedded slashes in response to requests from
remote machines. For instance, this could happen when someone on
a Mac or other non-Unix machine decides to create a remote NFS
file on your Unix machine with the date in the filename. Your
Unix directory then has this in it:

filename inode

91/02/07 12357

No amount of messing around with 'find' or 'rm' as described
above will delete this file, since those utilities and all other
Unix programs, are forced to interpret the '/' in the normal way.

Any ordinary program will eventually try to do
unlink("91/02/07"), which as far as the kernel is concerned means
"unlink the file 07 in the subdirectory 02 of directory 91", but
that's not what we have - we have a *FILE* named "91/02/07" in
the current directory. This is a subtle but crucial distinction.

What can you do in this case? The first thing to try is to
return to the Mac that created this crummy entry, and see if you
can convince it and your local NFS daemon to rename the file to
something without slashes.

If that doesn't work or isn't possible, you'll need help from
your system manager, who will have to try the one of the
following. Use "ls -i" to find the inode number of this bogus
file, then unmount the file system and use "clri" to clear the
inode, and "fsck" the file system with your fingers crossed.
This destroys the information in the file. If you want to keep
it, you can try:

create a new directory in the same parent directory as the one
containing the bad file name;

move everything you can (i.e. everything but the file with the
bad name) from the old directory to the new one;

do "ls -id" on the directory containing the file with the bad
name to get its inumber;

umount the file system;

"clri" the directory containing the file with the bad name;

"fsck" the file system.

Then, to find the file,

remount the file system;

rename the directory you created to have the name of the old
directory (since the old directory should have been blown away
by "fsck")

move the file out of "lost+found" into the directory with a
better name.

Alternatively, you can patch the directory the hard way by
crawling around in the raw file system. Use "fsdb", if you
have it.

2.3) How do I get a recursive directory listing?

One of the following may do what you want:

ls -R (not all versions of "ls" have -R)
find . -print (should work everywhere)
du -a . (shows you both the name and size)

If you're looking for a wildcard pattern that will match all ".c"
files in this directory and below, you won't find one, but you
can use

% some-command `find . -name '*.c' -print`

"find" is a powerful program. Learn about it.

2.4) How do I get the current directory into my prompt?

It depends which shell you are using. It's easy with some
shells, hard or impossible with others.

C Shell (csh):
Put this in your .cshrc - customize the prompt variable the
way you want.

alias setprompt 'set prompt="${cwd}% "'
setprompt # to set the initial prompt
alias cd 'chdir \!* && setprompt'

If you use pushd and popd, you'll also need

alias pushd 'pushd \!* && setprompt'
alias popd 'popd \!* && setprompt'

Some C shells don't keep a $cwd variable - you can use
`pwd` instead.

If you just want the last component of the current directory
in your prompt ("mail% " instead of "/usr/spool/mail% ")
you can use

alias setprompt 'set prompt="$cwd:t% "'

Some older csh's get the meaning of && and || reversed.
Try doing:

false && echo bug

If it prints "bug", you need to switch && and || (and get
a better version of csh.)

Bourne Shell (sh):

If you have a newer version of the Bourne Shell (SVR2 or newer)
you can use a shell function to make your own command, "xcd" say:

xcd() { cd $* ; PS1="`pwd` $ "; }

If you have an older Bourne shell, it's complicated but not
impossible. Here's one way. Add this to your .profile file:

LOGIN_SHELL=$$ export LOGIN_SHELL
CMDFILE=/tmp/cd.$$ export CMDFILE
# 16 is SIGURG, pick a signal that's not likely to be used
PROMPTSIG=16 export PROMPTSIG
trap '. $CMDFILE' $PROMPTSIG

and then put this executable script (without the indentation!),
let's call it "xcd", somewhere in your PATH

: xcd directory - change directory and set prompt
: by signalling the login shell to read a command file
cat >${CMDFILE?"not set"} <<EOF
cd $1
PS1="\`pwd\`$ "
EOF
kill -${PROMPTSIG?"not set"} ${LOGIN_SHELL?"not set"}

Now change directories with "xcd /some/dir".

Korn Shell (ksh):

Put this in your .profile file:
PS1='$PWD $ '

If you just want the last component of the directory, use
PS1='${PWD##*/} $ '

T C shell (tcsh)

Tcsh is a popular enhanced version of csh with some extra
builtin variables (and many other features):

%~ the current directory, using ~ for $HOME
%d or %/ the full pathname of the current directory
%c or %. the trailing component of the current directory

so you can do

set prompt='%~ '

BASH (FSF's "Bourne Again SHell")

\w in $PS1 gives the full pathname of the current directory,
with ~ expansion for $HOME; \W gives the basename of
the current directory. So, in addition to the above sh and
ksh solutions, you could use

PS1='\w $ '
or
PS1='\W $ '

2.5) How do I read characters from the terminal in a shell script?

In sh, use read. It is most common to use a loop like

while read line
do
...
done

In csh, use $< like this:

while ( 1 )
set line = "$<"
if ( "$line" == "" ) break
...
end

Unfortunately csh has no way of distinguishing between a blank
line and an end-of-file.

If you're using sh and want to read a *single* character from the
terminal, you can try something like

echo -n "Enter a character: "
stty cbreak # or stty raw
readchar=`dd if=/dev/tty bs=1 count=1 2>/dev/null`
stty -cbreak

echo "Thank you for typing a $readchar ."

2.6) How do I rename "*.foo" to "*.bar", or change file names to lowercase?

Why doesn't "mv *.foo *.bar" work? Think about how the shell
expands wildcards. "*.foo" and "*.bar" are expanded before the
mv command ever sees the arguments. Depending on your shell,
this can fail in a couple of ways. CSH prints "No match."
because it can't match "*.bar". SH executes "mv a.foo b.foo
c.foo *.bar", which will only succeed if you happen to have a
single directory named "*.bar", which is very unlikely and almost
certainly not what you had in mind.

Depending on your shell, you can do it with a loop to "mv" each
file individually. If your system has "basename", you can use:

C Shell:
foreach f ( *.foo )
set base=`basename $f .foo`
mv $f $base.bar
end

Bourne Shell:
for f in *.foo; do
base=`basename $f .foo`
mv $f $base.bar
done

Some shells have their own variable substitution features, so
instead of using "basename", you can use simpler loops like:

C Shell:

foreach f ( *.foo )
mv $f $f:r.bar
end

Korn Shell:

for f in *.foo; do
mv $f ${f%foo}bar
done

If you don't have "basename" or want to do something like
renaming foo.* to bar.*, you can use something like "sed" to
strip apart the original file name in other ways, but the general
looping idea is the same. You can also convert file names into
"mv" commands with 'sed', and hand the commands off to "sh" for
execution. Try

ls -d *.foo | sed -e 's/.*/mv & &/' -e 's/foo$/bar/' | sh

A program by Vladimir Lanin called "mmv" that does this job
nicely was posted to comp.sources.unix (Volume 21, issues 87 and
88) in April 1990. It lets you use

mmv '*.foo' '=1.bar'

Shell loops like the above can also be used to translate file
names from upper to lower case or vice versa. You could use
something like this to rename uppercase files to lowercase:

C Shell:
foreach f ( * )
mv $f `echo $f | tr '[A-Z]' '[a-z]'`
end
Bourne Shell:
for f in *; do
mv $f `echo $f | tr '[A-Z]' '[a-z]'`
done
Korn Shell:
typeset -l l
for f in *; do
l="$f"
mv $f $l
done

If you wanted to be really thorough and handle files with `funny'
names (embedded blanks or whatever) you'd need to use

Bourne Shell:

for f in *; do
g=`expr "xxx$f" : 'xxx\(.*\)' | tr '[A-Z]' '[a-z]'`
mv "$f" "$g"
done

The `expr' command will always print the filename, even if it
equals `-n' or if it contains a System V escape sequence like `\c'.

Some versions of "tr" require the [ and ], some don't. It
happens to be harmless to include them in this particular
example; versions of tr that don't want the [] will conveniently
think they are supposed to translate '[' to '[' and ']' to ']'.

If you have the "perl" language installed, you may find this
rename script by Larry Wall very useful. It can be used to
accomplish a wide variety of filename changes.

#!/usr/bin/perl
#
# rename script examples from lwall:
# rename 's/\.orig$//' *.orig
# rename 'y/A-Z/a-z/ unless /^Make/' *
# rename '$_ .= ".bad"' *.f
# rename 'print "$_: "; s/foo/bar/ if <stdin> =~ /^y/i' *

$op = shift;
for (@ARGV) {
$was = $_;
eval $op;
die $@ if $@;
rename($was,$_) unless $was eq $_;
}

2.7) Why do I get [some strange error message] when I "rsh host command" ?

(We're talking about the remote shell program "rsh" or sometimes
"remsh" or "remote"; on some machines, there is a restricted shell
called "rsh", which is a different thing.)

If your remote account uses the C shell, the remote host will
fire up a C shell to execute 'command' for you, and that shell
will read your remote .cshrc file. Perhaps your .cshrc contains
a "stty", "biff" or some other command that isn't appropriate for
a non-interactive shell. The unexpected output or error message
from these commands can screw up your rsh in odd ways.

Here's an example. Suppose you have

stty erase ^H
biff y

in your .cshrc file. You'll get some odd messages like this.

% rsh some-machine date
stty: : Can't assign requested address
Where are you?
Tue Oct 1 09:24:45 EST 1991

You might also get similar errors when running certain "at" or
"cron" jobs that also read your .cshrc file.

Fortunately, the fix is simple. There are, quite possibly, a
whole *bunch* of operations in your ".cshrc" (e.g., "set
history=N") that are simply not worth doing except in interactive
shells. What you do is surround them in your ".cshrc" with:

if ( $?prompt ) then
operations....
endif

and, since in a non-interactive shell "prompt" won't be set, the
operations in question will only be done in interactive shells.

You may also wish to move some commands to your .login file; if
those commands only need to be done when a login session starts
up (checking for new mail, unread news and so on) it's better to
have them in the .login file.

2.8) How do I {set an environment variable, change directory} inside
a program or shell script and have that change affect my
current shell?

In general, you can't, at least not without making special
arrangements. When a child process is created, it inherits a
copy of its parent's variables (and current directory). The
child can change these values all it wants but the changes won't
affect the parent shell, since the child is changing a copy of
the original data.

Some special arrangements are possible. Your child process could
write out the changed variables, if the parent was prepared to
read the output and interpret it as commands to set its own
variables.

Also, shells can arrange to run other shell scripts in the
context of the current shell, rather than in a child process, so
that changes will affect the original shell.

For instance, if you have a C shell script named "myscript":

cd /very/long/path
setenv PATH /something:/something-else

or the equivalent Bourne or Korn shell script

cd /very/long/path
PATH=/something:/something-else export PATH

and try to run "myscript" from your shell, your shell will fork
and run the shell script in a subprocess. The subprocess is also
running the shell; when it sees the "cd" command it changes *its*
current directory, and when it sees the "setenv" command it
changes *its* environment, but neither has any effect on the
current directory of the shell at which you're typing (your login
shell, let's say).

In order to get your login shell to execute the script (without
forking) you have to use the "." command (for the Bourne or Korn
shells) or the "source" command (for the C shell). I.e. you type

. myscript

to the Bourne or Korn shells, or

source myscript

to the C shell.

If all you are trying to do is change directory or set an
environment variable, it will probably be simpler to use a C
shell alias or Bourne/Korn shell function. See the "how do I get
the current directory into my prompt" section of this article for
some examples.

2.9) How do I redirect stdout and stderr separately in csh?

In csh, you can redirect stdout with ">", or stdout and stderr
together with ">&" but there is no direct way to redirect stderr
only. The best you can do is

( command >stdout_file ) >&stderr_file

which runs "command" in a subshell; stdout is redirected inside
the subshell to stdout_file, and both stdout and stderr from the
subshell are redirected to stderr_file, but by this point stdout
has already been redirected so only stderr actually winds up in
stderr_file.

Sometimes it's easier to let sh do the work for you.

sh -c 'command >stdout_file 2>stderr_file'

2.10) How do I tell inside .cshrc if I'm a login shell?

When people ask this, they usually mean either

How can I tell if it's an interactive shell? or
How can I tell if it's a top-level shell?

You could perhaps determine if your shell truly is a login shell
(i.e. is going to source ".login" after it is done with ".cshrc")
by fooling around with "ps" and "$$". Login shells generally
have names that begin with a '-'. If you're really interested in
the other two questions, here's one way you can organize your
.cshrc to find out.

if (! $?CSHLEVEL) then
#
# This is a "top-level" shell,
# perhaps a login shell, perhaps a shell started up by
# 'rsh machine some-command'
# This is where we should set PATH and anything else we
# want to apply to every one of our shells.
#
setenv CSHLEVEL 0
set home = ~username # just to be sure
source ~/.env # environment stuff we always want
else
#
# This shell is a child of one of our other shells so
# we don't need to set all the environment variables again.
#
set tmp = $CSHLEVEL
@ tmp++
setenv CSHLEVEL $tmp
endif

# Exit from .cshrc if not interactive, e.g. under rsh
if (! $?prompt) exit

# Here we could set the prompt or aliases that would be useful
# for interactive shells only.

source ~/.aliases

2.11) How do I construct a shell glob-pattern that matches all files
except "." and ".." ?

You'd think this would be easy.

* Matches all files that don't begin with a ".";

.* Matches all files that do begin with a ".", but
this includes the special entries "." and "..",
which often you don't want;

.[!.]* (Newer shells only; some shells use a "^" instead of
the "!"; POSIX shells must accept the "!", but may
accept a "^" as well; all portable applications shall
not use an unquoted "^" immediately following the "[")

Matches all files that begin with a "." and are
followed by a non-"."; unfortunately this will miss
"..foo";

.??* Matches files that begin with a "." and which are
at least 3 characters long. This neatly avoids
"." and "..", but also misses ".a" .

So to match all files except "." and ".." safely you have to use
3 patterns (if you don't have filenames like ".a" you can leave
out the first):

.[!.]* .??* *

Alternatively you could employ an external program or two and use
backquote substitution. This is pretty good:

`ls -a | sed -e '/^\.$/d' -e '/^\.\.$/d'`

(or `ls -A` in some Unix versions)

but even it will mess up on files with newlines, IFS characters
or wildcards in their names.

2.12) How do I find the last argument in a Bourne shell script?

Answer by:
Martin Weitzel <@mikros.systemware.de:mar...@mwtech.uucp>
Maarten Litmaath <ma...@nat.vu.nl>

If you are sure the number of arguments is at most 9, you can use:

eval last=\${$#}

In POSIX-compatible shells it works for ANY number of arguments.
The following works always too:

for last
do
:
done

This can be generalized as follows:

for i
do
third_last=$second_last
second_last=$last
last=$i
done

Now suppose you want to REMOVE the last argument from the list,
or REVERSE the argument list, or ACCESS the N-th argument
directly, whatever N may be. Here is a basis of how to do it,
using only built-in shell constructs, without creating subprocesses:

t0= u0= rest='1 2 3 4 5 6 7 8 9' argv=

for h in '' $rest
do
for t in "$t0" $rest
do
for u in $u0 $rest
do
case $# in
0)
break 3
esac
eval argv$h$t$u=\$1
argv="$argv \"\$argv$h$t$u\"" # (1)
shift
done
u0=0
done
t0=0
done

# now restore the arguments
eval set x "$argv" # (2)
shift

This example works for the first 999 arguments. Enough?
Take a good look at the lines marked (1) and (2) and convince
yourself that the original arguments are restored indeed, no
matter what funny characters they contain!

To find the N-th argument now you can use this:

eval argN=\$argv$N

To reverse the arguments the line marked (1) must be changed to:

argv="\"\$argv$h$t$u\" $argv"

How to remove the last argument is left as an exercise.

If you allow subprocesses as well, possibly executing nonbuilt-in
commands, the `argvN' variables can be set up more easily:

N=1

for i
do
eval argv$N=\$i
N=`expr $N + 1`
done

To reverse the arguments there is still a simpler method, that
even does not create subprocesses. This approach can also be
taken if you want to delete e.g. the last argument, but in that
case you cannot refer directly to the N-th argument any more,
because the `argvN' variables are set up in reverse order:

argv=

for i
do
eval argv$#=\$i
argv="\"\$argv$#\" $argv"
shift
done

eval set x "$argv"
shift

2.13) What's wrong with having '.' in your $PATH ?

A bit of background: the PATH environment variable is a list of
directories separated by colons. When you type a command name
without giving an explicit path (e.g. you type "ls", rather than
"/bin/ls") your shell searches each directory in the PATH list in
order, looking for an executable file by that name, and the shell
will run the first matching program it finds.

One of the directories in the PATH list can be the current
directory "." . It is also permissible to use an empty directory
name in the PATH list to indicate the current directory. Both of
these are equivalent

for csh users:

setenv PATH :/usr/ucb:/bin:/usr/bin
setenv PATH .:/usr/ucb:/bin:/usr/bin

for sh or ksh users

PATH=:/usr/ucb:/bin:/usr/bin export PATH
PATH=.:/usr/ucb:/bin:/usr/bin export PATH

Having "." somewhere in the PATH is convenient - you can type
"a.out" instead of "./a.out" to run programs in the current
directory. But there's a catch.

Consider what happens in the case where "." is the first entry
in the PATH. Suppose your current directory is a publically-
writable one, such as "/tmp". If there just happens to be a
program named "/tmp/ls" left there by some other user, and you
type "ls" (intending, of course, to run the normal "/bin/ls"
program), your shell will instead run "./ls", the other user's
program. Needless to say, the results of running an unknown
program like this might surprise you.

It's slightly better to have "." at the end of the PATH:

setenv PATH /usr/ucb:/bin:/usr/bin:.

Now if you're in /tmp and you type "ls", the shell will
search /usr/ucb, /bin and /usr/bin for a program named
"ls" before it gets around to looking in ".", and there
is less risk of inadvertently running some other user's
"ls" program. This isn't 100% secure though - if you're
a clumsy typist and some day type "sl -l" instead of "ls -l",
you run the risk of running "./sl", if there is one.
Some "clever" programmer could anticipate common typing
mistakes and leave programs by those names scattered
throughout public directories. Beware.

Many seasoned Unix users get by just fine without having
"." in the PATH at all:

setenv PATH /usr/ucb:/bin:/usr/bin

If you do this, you'll need to type "./program" instead
of "program" to run programs in the current directory, but
the increase in security is probably worth it.

--
Ted Timar - tmat...@sunee.uwaterloo.ca
Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3

-----------------------------

From: Ted Timar <tmat...@sunee.uwaterloo.ca>
Subject: Frequently Asked Questions about Unix (4/4) [Monthly posting]
Date: 9 Oct 92 05:03:15 GMT
Expires: Fri, 6 Nov 1992 05:00:14 GMT
Sender: News system <ne...@athena.mit.edu>
Followup-To: comp.unix.questions
Approved: news-answe...@MIT.Edu
Supersedes: <unix-faq/part4_7...@athena.mit.edu>
X-Last-Updated: 1992/09/24
Nntp-Posting-Host: pit-manager.mit.edu
To: info...@sem.brl.mil

Archive-name: unix-faq/part4
Version: $Id: part4,v 1.6 92/09/11 09:15:32 tmatimar Exp $

These four articles contain the answers to some Frequently Asked
Questions often seen in comp.unix.questions and comp.unix.shell.
Please don't ask these questions again, they've been answered plenty
of times already - and please don't flame someone just because they may
not have read this particular posting. Thank you.

These articles are divided approximately as follows:

1.*) General questions.
2.*) Relatively basic questions, likely to be asked by beginners.
3.*) Intermediate questions.
4.*) Advanced questions, likely to be asked by people who thought
they already knew all of the answers.

This article includes answers to:

4.1) How do I read characters from a terminal without requiring the user
to hit RETURN?
4.2) How do I check to see if there are characters to be read without
actually reading?
4.3) How do I find the name of an open file?
4.4) How can an executing program determine its own pathname?
4.5) How do I use popen() to open a process for reading AND writing?
4.6) How do I sleep() in a C program for less than one second?
4.7) How can I get setuid shell scripts to work?
4.8) How can I find out which user or process has a file open or is using
a particular file system (so that I can unmount it?)
4.9) How do I keep track of people who are fingering me?
4.10) Is it possible to reconnect a process to a terminal after it has
been disconnected, e.g. after starting a program in the background
and logging out?
4.11) Is it possible to "spy" on a terminal, displaying the output
that's appearing on it on another terminal?

If you're looking for the answer to, say, question 4.5, and want to skip
everything else, you can search ahead for the regular expression "^4.5)".

While these are all legitimate questions, they seem to crop up in
comp.unix.questions on an annual basis, usually followed by plenty
of replies (only some of which are correct) and then a period of
griping about how the same questions keep coming up. You may also like
to read the monthly article "Answers to Frequently Asked Questions"
in the newsgroup "news.announce.newusers", which will tell you what
"UNIX" stands for.

With the variety of Unix systems in the world, it's hard to guarantee
that these answers will work everywhere. Read your local manual pages
before trying anything suggested here. If you have suggestions or
corrections for any of these answers, please send them to to
tmat...@sunee.uwaterloo.ca.

4.1) How do I read characters from a terminal without requiring the user
to hit RETURN?

Check out cbreak mode in BSD, ~ICANON mode in SysV.

If you don't want to tackle setting the terminal parameters
yourself (using the "ioctl(2)" system call) you can let the stty
program do the work - but this is slow and inefficient, and you
should change the code to do it right some time:

#include <stdio.h>
main()
{
int c;

printf("Hit any character to continue\n");
/*
* ioctl() would be better here; only lazy
* programmers do it this way:
*/
system("/bin/stty cbreak"); /* or "stty raw" */
c = getchar();
system("/bin/stty -cbreak");
printf("Thank you for typing %c.\n", c);

exit(0);
}

You might like to check out the documentation for the "curses"
library of portable screen functions. Often if you're interested
in single-character I/O like this, you're also interested in
doing some sort of screen display control, and the curses library
provides various portable routines for both functions.

4.2) How do I check to see if there are characters to be read without
actually reading?

Certain versions of UNIX provide ways to check whether characters
are currently available to be read from a file descriptor. In
BSD, you can use select(2). You can also use the FIONREAD ioctl
(see tty(4)), which returns the number of characters waiting to
be read, but only works on terminals, pipes and sockets. In
System V Release 3, you can use poll(2), but that only works on
streams. In Xenix - and therefore Unix SysV r3.2 and later - the
rdchk() system call reports whether a read() call on a given file
descriptor will block.

There is no way to check whether characters are available to be
read from a FILE pointer. (You could poke around inside stdio
data structures to see if the input buffer is nonempty, but that
wouldn't work since you'd have no way of knowing what will happen
the next time you try to fill the buffer.)

Sometimes people ask this question with the intention of writing
if (characters available from fd)
read(fd, buf, sizeof buf);
in order to get the effect of a nonblocking read. This is not
the best way to do this, because it is possible that characters
will be available when you test for availability, but will no
longer be available when you call read. Instead, set the
O_NDELAY flag (which is also called FNDELAY under BSD) using the
F_SETFL option of fcntl(2). Older systems (Version 7, 4.1 BSD)
don't have O_NDELAY; on these systems the closest you can get to
a nonblocking read is to use alarm(2) to time out the read.

4.3) How do I find the name of an open file?

In general, this is too difficult. The file descriptor may
be attached to a pipe or pty, in which case it has no name.
It may be attached to a file that has been removed. It may
have multiple names, due to either hard or symbolic links.

If you really need to do this, and be sure you think long
and hard about it and have decided that you have no choice,
you can use find with the -inum and possibly -xdev option,
or you can use ncheck, or you can recreate the functionality
of one of these within your program. Just realize that
searching a 600 megabyte filesystem for a file that may not
even exist is going to take some time.

4.4) How can an executing program determine its own pathname?

Your program can look at argv[0]; if it begins with a "/", it is
probably the absolute pathname to your program, otherwise your
program can look at every directory named in the environment
variable PATH and try to find the first one that contains an
executable file whose name matches your program's argv[0] (which
by convention is the name of the file being executed). By
concatenating that directory and the value of argv[0] you'd
probably have the right name.

You can't really be sure though, since it is quite legal for one
program to exec() another with any value of argv[0] it desires.
It is merely a convention that new programs are exec'd with the
executable file name in argv[0].

For instance, purely a hypothetical example:

#include <stdio.h>
main()
{
execl("/usr/games/rogue", "vi Thesis", (char *)NULL);
}

The executed program thinks its name (its argv[0] value) is
"vi Thesis". (Certain other programs might also think that
the name of the program you're currently running is "vi Thesis",
but of course this is just a hypothetical example, don't
try it yourself :-)

4.5) How do I use popen() to open a process for reading AND writing?

The problem with trying to pipe both input and output to an
arbitrary slave process is that deadlock can occur, if both
processes are waiting for not-yet-generated input at the same
time. Deadlock can be avoided only by having BOTH sides follow a
strict deadlock-free protocol, but since that requires
cooperation from the processes it is inappropriate for a
popen()-like library function.

The 'expect' distribution includes a library of functions that a
C programmer can call directly. One of the functions does the
equivalent of a popen for both reading and writing. It uses ptys
rather than pipes, and has no deadlock problem. It's portable to
both BSD and SV. See the next answer for more about 'expect'.

4.6) How do I sleep() in a C program for less than one second?

The first thing you need to be aware of is that all you can
specify is a MINIMUM amount of delay; the actual delay will
depend on scheduling issues such as system load, and could be
arbitrarily large if you're unlucky.

There is no standard library function that you can count on in
all environments for "napping" (the usual name for short
sleeps). Some environments supply a "usleep(n)" function which
suspends execution for n microseconds. If your environment
doesn't support usleep(), here are a couple of implementations
for BSD and System V environments.

The following code is adapted from Doug Gwyn's System V emulation
support for 4BSD and exploits the 4BSD select() system call.
Doug originally called it 'nap()'; you probably want to call it
"usleep()";

/*
usleep -- support routine for 4.2BSD system call emulations
last edit: 29-Oct-1984 D A Gwyn
*/

extern int select();

int
usleep( usec ) /* returns 0 if ok, else -1 */
long usec; /* delay in microseconds */
{
static struct /* `timeval' */
{
long tv_sec; /* seconds */
long tv_usec; /* microsecs */
} delay; /* _select() timeout */

delay.tv_sec = usec / 1000000L;
delay.tv_usec = usec % 1000000L;

return select( 0, (long *)0, (long *)0, (long *)0, &delay );
}

On System V you might do it this way:

/*
subseconds sleeps for System V - or anything that has poll()
Don Libes, 4/1/1991

The BSD analog to this function is defined in terms of
microseconds while poll() is defined in terms of milliseconds.
For compatibility, this function provides accuracy "over the long
run" by truncating actual requests to milliseconds and
accumulating microseconds across calls with the idea that you are
probably calling it in a tight loop, and that over the long run,
the error will even out.

If you aren't calling it in a tight loop, then you almost
certainly aren't making microsecond-resolution requests anyway,
in which case you don't care about microseconds. And if you did,
you wouldn't be using UNIX anyway because random system
indigestion (i.e., scheduling) can make mincemeat out of any
timing code.

Returns 0 if successful timeout, -1 if unsuccessful.

*/

#include <poll.h>

int
usleep(usec)
unsigned int usec; /* microseconds */
{
static subtotal = 0; /* microseconds */
int msec; /* milliseconds */

/* 'foo' is only here because some versions of 5.3 have
* a bug where the first argument to poll() is checked
* for a valid memory address even if the second argument is 0.
*/
struct pollfd foo;

subtotal += usec;
/* if less then 1 msec request, do nothing but remember it */
if (subtotal < 1000) return(0);
msec = subtotal/1000;
subtotal = subtotal%1000;
return poll(&foo,(unsigned long)0,msec);
}

Another possibility for nap()ing on System V, and probably other
non-BSD Unices is Jon Zeeff's s5nap package, posted to
comp.sources.misc, volume 4. It does require a installing a
device driver, but works flawlessly once installed. (Its
resolution is limited to the kernel HZ value, since it uses the
kernel delay() routine.)

4.7) How can I get setuid shell scripts to work?

[ This is a long answer, but it's a complicated and frequently-asked
question. Thanks to Maarten Litmaath for this answer, and
for the "indir" program mentioned below. ]

Let us first assume you are on a UNIX variant (e.g. 4.3BSD or
SunOS) that knows about so-called `executable shell scripts'.
Such a script must start with a line like:

#!/bin/sh

The script is called `executable' because just like a real (binary)
executable it starts with a so-called `magic number' indicating
the type of the executable. In our case this number is `#!' and
the OS takes the rest of the first line as the interpreter for
the script, possibly followed by 1 initial option like:

#!/bin/sed -f

Suppose this script is called `foo' and is found in /bin,
then if you type:

foo arg1 arg2 arg3

the OS will rearrange things as though you had typed:

/bin/sed -f /bin/foo arg1 arg2 arg3

There is one difference though: if the setuid permission bit for
`foo' is set, it will be honored in the first form of the
command; if you really type the second form, the OS will honor
the permission bits of /bin/sed, which is not setuid, of course.

----------

OK, but what if my shell script does NOT start with such a `#!'
line or my OS does not know about it?

Well, if the shell (or anybody else) tries to execute it, the OS
will return an error indication, as the file does not start with
a valid magic number. Upon receiving this indication the shell
ASSUMES the file to be a shell script and gives it another try:

/bin/sh shell_script arguments

But we have already seen that a setuid bit on `shell_script' will
NOT be honored in this case!

----------

Right, but what about the security risks of setuid shell scripts?

Well, suppose the script is called `/etc/setuid_script', starting
with:

#!/bin/sh

Now let us see what happens if we issue the following commands:

$ cd /tmp
$ ln /etc/setuid_script -i
$ PATH=.
$ -i

We know the last command will be rearranged to:

/bin/sh -i

But this command will give us an interactive shell, setuid to the
owner of the script!
Fortunately this security hole can easily be closed by making the
first line:

#!/bin/sh -

The `-' signals the end of the option list: the next argument `-i'
will be taken as the name of the file to read commands from, just
like it should!

---------

There are more serious problems though:

$ cd /tmp
$ ln /etc/setuid_script temp
$ nice -20 temp &
$ mv my_script temp

The third command will be rearranged to:

nice -20 /bin/sh - temp

As this command runs so slowly, the fourth command might be able
to replace the original `temp' with `my_script' BEFORE `temp' is
opened by the shell! There are 4 ways to fix this security hole:

1) let the OS start setuid scripts in a different, secure way
- System V R4 and 4.4BSD use the /dev/fd driver to pass the
interpreter a file descriptor for the script

2) let the script be interpreted indirectly, through a frontend
that makes sure everything is all right before starting the
real interpreter - if you use the `indir' program from
comp.sources.unix the setuid script will look like this:

#!/bin/indir -u
#?/bin/sh /etc/setuid_script

3) make a `binary wrapper': a real executable that is setuid and
whose only task is to execute the interpreter with the name of
the script as an argument

4) make a general `setuid script server' that tries to locate the
requested `service' in a database of valid scripts and upon
success will start the right interpreter with the right
arguments.

---------

Now that we have made sure the right file gets interpreted, are
there any risks left?

Certainly! For shell scripts you must not forget to set the PATH
variable to a safe path explicitly. Can you figure out why?
Also there is the IFS variable that might cause trouble if not
set properly. Other environment variables might turn out to
compromise security as well, e.g. SHELL... Furthermore you must
make sure the commands in the script do not allow interactive
shell escapes! Then there is the umask which may have been set
to something strange...

Etcetera. You should realise that a setuid script `inherits' all
the bugs and security risks of the commands that it calls!

All in all we get the impression setuid shell scripts are quite a
risky business! You may be better off writing a C program instead!

4.8) How can I find out which user or process has a file open or is using
a particular file system (so that I can unmount it?)

Use fuser (system V), fstat (BSD), ofiles (public domain) or
pff (public domain). These programs will tell you various things
about processes using particular files.

A port of the 4.3 BSD fstat to Dynix, SunOS and Ultrix
can be found in archives of comp.sources.unix, volume 18.

pff is part of the kstuff package, and works on quite a few systems.
Instructions for obtaining kstuff are provided in question 3.10.

4.9) How do I keep track of people who are fingering me?

Generally, you can't find out the userid of someone who is
fingering you from a remote machine. You may be able to
find out which machine the remote request is coming from.
One possibility, if your system supports it and assuming
the finger daemon doesn't object, is to make your .plan file a
"named pipe" instead of a plain file. (Use 'mknod' to do this.)

You can then start up a program that will open your .plan file
for writing; the open will block until some other process (namely
fingerd) opens the .plan for reading. Now you can whatever you
want through this pipe, which lets you show different .plan
information every time someone fingers you.

Of course, this may not work at all if your system doesn't
support named pipes or if your local fingerd insists
on having plain .plan files.

Your program can also take the opportunity to look at the output
of "netstat" and spot where an incoming finger connection is
coming from, but this won't get you the remote user.

Getting the remote userid would require that the remote site be
running an identity service such as RFC 931. There are now three
RFC 931 implementations for popular BSD machines, and several
applications (such as the wuarchive ftpd) supporting the server.
For more information join the rfc931-users mailing list,
rfc931-use...@kramden.acf.nyu.edu.

There are two caveats relating to this answer. The first is that
many NFS systems won't allow the recognize the named pipe
correctly. This means that trying to read the pipe on another
machine will either block until it times out, or see it as a
zero-length file, and never print it.

The second problem is that on many systems, fingerd checks that
the .plan file contains data (and is readable) before trying to
read it. This will not cause remote fingers to miss your .plan
file entirely.

4.10) Is it possible to reconnect a process to a terminal after it has
been disconnected, e.g. after starting a program in the background
and logging out?

Most variants of Unix do not support "detaching" and "attaching"
processes, as operating systems such as VMS and Multics support.
However, there are two freely redistributable packages which can
be used to start processes in such a way that they can be later
reattached to a terminal.

The first is "screen," which is described in the
comp.sources.unix archives as "Screen, multiple windows on a CRT"
(see the "screen-3.2" package in comp.sources.misc, volume 28.)
This package will run on at least BSD, System V r3.2 and SCO UNIX.

The second is "pty," which is described in the comp.sources.unix
archives as a package to "Run a program under a pty session" (see
"pty" in volume 23). pty is designed for use under BSD-like
system only.

Neither of these packages is retroactive, i.e. you must have
started a process under screen or pty in order to be able to
detach and reattach it.

4.11) Is it possible to "spy" on a terminal, displaying the output
that's appearing on it on another terminal?

There are a few different ways you can do this, although none
of them is perfect:

* kibitz allows two (or more) people to interact with a shell
(or any arbitary program). Uses include:

- watching or aiding another person's terminal session;
- recording a conversation while retaining the ability to
scroll backwards, save the conversation, or even edit it
while in progress;
- teaming up on games, document editing, or other cooperative
tasks where each person has strengths and weakness that
complement one another.

kibitz comes as part of the expect distribution. See question 3.9.

kibitz requires permission from the person to be spyed upon. To
spy without permission requires less pleasant approaches:

* You can write a program that grovels through Kernel structures
and watches the output buffer for the terminal in question,
displaying characters as they are output. This, obviously, is
not something that should be attempted by anyone who does not
have experience working with the Unix kernel. Furthermore,
whatever method you come up with will probably be quite
non-portable.

* If you want to do this to a particular hard-wired terminal all
the time (e.g. if you want operators to be able to check the
console terminal of a machine from other machines), you can
actually splice a monitor into the cable for the terminal. For
example, plug the monitor output into another machine's serial
port, and run a program on that port that stores its input
somewhere and then transmits it out *another* port, this one
really going to the physical terminal. If you do this, you have
to make sure that any output from the terminal is transmitted
back over the wire, although if you splice only into the
computer->terminal wires, this isn't much of a problem. This is
not something that should be attempted by anyone who is not very
familiar with terminal wiring and such.

--
Ted Timar - tmat...@sunee.uwaterloo.ca
Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3

-----------------------------

From: Ted Timar <tmat...@sunee.uwaterloo.ca>
Subject: Frequently Asked Questions about Unix (3/4) [Monthly posting]
Date: 9 Oct 92 05:03:37 GMT
Expires: Fri, 6 Nov 1992 05:00:14 GMT
Sender: News system <ne...@athena.mit.edu>
Followup-To: comp.unix.questions
Approved: news-answe...@MIT.Edu
Supersedes: <unix-faq/part3_7...@athena.mit.edu>
X-Last-Updated: 1992/09/24
Nntp-Posting-Host: pit-manager.mit.edu
To: info...@sem.brl.mil

Archive-name: unix-faq/part3
Version: $Id: part3,v 1.6 92/09/11 09:15:30 tmatimar Exp $

These four articles contain the answers to some Frequently Asked
Questions often seen in comp.unix.questions and comp.unix.shell.
Please don't ask these questions again, they've been answered plenty
of times already - and please don't flame someone just because they may
not have read this particular posting. Thank you.

These articles are divided approximately as follows:

1.*) General questions.
2.*) Relatively basic questions, likely to be asked by beginners.
3.*) Intermediate questions.
4.*) Advanced questions, likely to be asked by people who thought
they already knew all of the answers.

This article includes answers to:

3.1) How do I find out the creation time of a file?
3.2) How do I use "rsh" without having the rsh hang around
until the remote command has completed?
3.3) How do I truncate a file?
3.4) Why doesn't find's "{}" symbol do what I want?
3.5) How do I set the permissions on a symbolic link?
3.6) How do I "undelete" a file?
3.7) How can a process detect if it's running in the background?
3.8) Why doesn't redirecting a loop work as intended? (Bourne shell)
3.9) How do I run 'passwd', 'ftp', 'telnet', 'tip' and other interactive
programs from a shell script or in the background?
3.10) How do I find out the process ID of a program with a particular
name from inside a shell script or C program?
3.11) How do I check the exit status of a remote command
executed via "rsh" ?
3.12) Is it possible to pass shell variable settings into an awk program?
3.13) How do I get rid of zombie processes that persevere?
3.14) How do I get lines from a pipe as they are written instead of
only in larger blocks.

If you're looking for the answer to, say, question 3.5, and want to skip
everything else, you can search ahead for the regular expression "^3.5)".

While these are all legitimate questions, they seem to crop up in
comp.unix.questions on an annual basis, usually followed by plenty
of replies (only some of which are correct) and then a period of
griping about how the same questions keep coming up. You may also like
to read the monthly article "Answers to Frequently Asked Questions"
in the newsgroup "news.announce.newusers", which will tell you what
"UNIX" stands for.

With the variety of Unix systems in the world, it's hard to guarantee
that these answers will work everywhere. Read your local manual pages
before trying anything suggested here. If you have suggestions or
corrections for any of these answers, please send them to to
tmat...@sunee.uwaterloo.ca.

3.1) How do I find out the creation time of a file?

You can't - it isn't stored anywhere. Files have a last-modified
time (shown by "ls -l"), a last-accessed time (shown by "ls -lu")
and an inode change time (shown by "ls -lc"). The latter is often
referred to as the "creation time" - even in some man pages -
but that's wrong; it's also set by such operations as mv, ln,
chmod, chown and chgrp.

The man page for "stat(2)" discusses this.

3.2) How do I use "rsh" without having the rsh hang around until the
remote command has completed?

(See note in question 2.7 about what "rsh" we're talking about.)

The obvious answers fail:
rsh machine command &
or rsh machine 'command &'

For instance, try doing rsh machine 'sleep 60 &' and you'll see
that the 'rsh' won't exit right away. It will wait 60 seconds
until the remote 'sleep' command finishes, even though that
command was started in the background on the remote machine. So
how do you get the 'rsh' to exit immediately after the 'sleep' is
started?

The solution - if you use csh on the remote machine:

rsh machine -n 'command >&/dev/null </dev/null &'

If you use sh on the remote machine:

rsh machine -n 'command >/dev/null 2>&1 </dev/null &'

Why? "-n" attaches rsh's stdin to /dev/null so you could run the
complete rsh command in the background on the LOCAL machine.
Thus "-n" is equivalent to another specific "< /dev/null".
Furthermore, the input/output redirections on the REMOTE machine
(inside the single quotes) ensure that rsh thinks the session can
be terminated (there's no data flow any more.)

Note: The file that you redirect to/from on the remote machine
doesn't have to be /dev/null; any ordinary file will do.

In many cases, various parts of these complicated commands
aren't necessary.

3.3) How do I truncate a file?

The BSD function ftruncate() sets the length of a file. Xenix -
and therefore SysV r3.2 and later - has the chsize() system
call. For other systems, the only kind of truncation you can do
is truncation to length zero with creat() or open(..., O_TRUNC).

3.4) Why doesn't find's "{}" symbol do what I want?

"find" has a -exec option that will execute a particular command
on all the selected files. Find will replace any "{}" it sees
with the name of the file currently under consideration.

So, some day you might try to use "find" to run a command on
every file, one directory at a time. You might try this:

find /path -type d -exec command {}/\* \;

hoping that find will execute, in turn

command directory1/*
command directory2/*
...

Unfortunately, find only expands the "{}" token when it appears
by itself. Find will leave anything else like "{}/*" alone, so
instead of doing what you want, it will do

command {}/*
command {}/*
...

once for each directory. This might be a bug, it might be a
feature, but we're stuck with the current behaviour.

So how do you get around this? One way would be to write a
trivial little shell script, let's say "./doit", that consists of

command "$1"/*

You could then use

find /path -type d -exec ./doit {} \;

Or if you want to avoid the "./doit" shell script, you can use

find /path -type d -exec sh -c 'command $0/*' {} \;

(This works because within the 'command' of "sh -c 'command' A B C ...",
$0 expands to A, $1 to B, and so on.)

or you can use the construct-a-command-with-sed trick

find /path -type d -print | sed 's:.*:command &/*:' | sh

If all you're trying to do is cut down on the number of times
that "command" is executed, you should see if your system has the
"xargs" command. Xargs reads arguments one line at a time from
the standard input and assembles as many of them as will fit into
one command line. You could use

find /path -print | xargs command

which would result in one or more executions of

command file1 file2 file3 file4 dir1/file1 dir1/file2

Unfortunately this is not a perfectly robust or secure solution.
Xargs expects its input lines to be terminated with newlines, so
it will be confused by files with odd characters such as newlines
in their names.

3.5) How do I set the permissions on a symbolic link?

Permissions on a symbolic link don't really mean anything. The
only permissions that count are the permissions on the file that
the link points to.

3.6) How do I "undelete" a file?

Someday, you are going to accidentally type something like "rm *
.foo", and find you just deleted "*" instead of "*.foo".
Consider it a rite of passage.

Of course, any decent systems administrator should be doing
regular backups. Check with your sysadmin to see if a recent
backup copy of your file is available. But if it isn't, read
on.

For all intents and purposes, when you delete a file with "rm" it
is gone. Once you "rm" a file, the system totally forgets which
blocks scattered around the disk comprised your file. Even
worse, the blocks from the file you just deleted are going to be
the first ones taken and scribbled upon when the system needs
more disk space. However, never say never. It is theoretically
possible *if* you shut down the system immediately after the "rm"
to recover portions of the data. However, you had better have a
very wizardly type person at hand with hours or days to spare to
get it all back.

Your first reaction when you "rm" a file by mistake is why not
make a shell alias or procedure which changes "rm" to move files
into a trash bin rather than delete them? That way you can
recover them if you make a mistake, and periodically clean out
your trash bin. Two points: first, this is generally accepted
as a *bad* idea. You will become dependent upon this behaviour
of "rm", and you will find yourself someday on a normal system
where "rm" is really "rm", and you will get yourself in trouble.
Second, you will eventually find that the hassle of dealing with
the disk space and time involved in maintaining the trash bin, it
might be easier just to be a bit more careful with "rm". For
starters, you should look up the "-i" option to "rm" in your
manual.

If you are still undaunted, then here is a possible simple
answer. You can create yourself a "can" command which moves
files into a trashcan directory. In csh(1) you can place the
following commands in the ".login" file in your home directory:

alias can 'mv \!* ~/.trashcan' # junk file(s) to trashcan
alias mtcan 'rm -f ~/.trashcan/*' # irretrievably empty trash
if ( ! -d ~/.trashcan ) mkdir ~/.trashcan # ensure trashcan exists

You might also want to put a:

rm -f ~/.trashcan/*

in the ".logout" file in your home directory to automatically
empty the trash when you log out. (sh and ksh versions are left
as an exercise for the reader.)

MIT's Project Athena has produced a comprehensive
delete/undelete/expunge/purge package, which can serve as a
complete replacement for rm which allows file recovery. This
package was posted to comp.sources.misc (volume 17, issue
023-026)

3.7) How can a process detect if it's running in the background?

First of all: do you want to know if you're running in the
background, or if you're running interactively? If you're
deciding whether or not you should print prompts and the like,
that's probably a better criterion. Check if standard input
is a terminal:

sh: if [ -t 0 ]; then ... fi
C: if(isatty(0)) { ... }

In general, you can't tell if you're running in the background.
The fundamental problem is that different shells and different
versions of UNIX have different notions of what "foreground" and
"background" mean - and on the most common type of system with a
better-defined notion of what they mean, programs can be moved
arbitrarily between foreground and background!

UNIX systems without job control typically put a process into the
background by ignoring SIGINT and SIGQUIT and redirecting the
standard input to "/dev/null"; this is done by the shell.

Shells that support job control, on UNIX systems that support job
control, put a process into the background by giving it a process
group ID different from the process group to which the terminal
belongs. They move it back into the foreground by setting the
terminal's process group ID to that of the process. Shells that
do *not* support job control, on UNIX systems that support job
control, typically do what shells do on systems that don't
support job control.

3.8) Why doesn't redirecting a loop work as intended? (Bourne shell)

Take the following example:

foo=bar

while read line
do
# do something with $line
foo=bletch
done < /etc/passwd

echo "foo is now: $foo"

Despite the assignment ``foo=bletch'' this will print
``foo is now: bar'' in many implementations of the Bourne shell.
Why? Because of the following, often undocumented, feature of
historic Bourne shells: redirecting a control structure (such as
a loop, or an ``if'' statement) causes a subshell to be created,
in which the structure is executed; variables set in that
subshell (like the ``foo=bletch'' assignment) don't affect the
current shell, of course.

The POSIX 1003.2 Shell and Tools Interface standardization
committee forbids the behaviour described above, i.e. in P1003.2
conformant Bourne shells the example will print ``foo is now:
bletch''.

In historic (and P1003.2 conformant) implementations you can use
the following `trick' to get around the redirection problem:

foo=bar

# make file descriptor 9 a duplicate of file descriptor 0 (stdin);
# then connect stdin to /etc/passwd; the original stdin is now
# `remembered' in file descriptor 9; see dup(2) and sh(1)
exec 9<&0 < /etc/passwd

while read line
do
# do something with $line
foo=bletch
done

# make stdin a duplicate of file descriptor 9, i.e. reconnect
# it to the original stdin; then close file descriptor 9
exec 0<&9 9<&-

echo "foo is now: $foo"

This should always print ``foo is now: bletch''.
Right, take the next example:

foo=bar

echo bletch | read foo

echo "foo is now: $foo"

This will print ``foo is now: bar'' in many implementations,
``foo is now: bletch'' in some others. Why? Generally each part
of a pipeline is run in a different subshell; in some
implementations though, the last command in the pipeline is made
an exception: if it is a builtin command like ``read'', the
current shell will execute it, else another subshell is created.

POSIX 1003.2 allows both behaviours so portable scripts cannot
depend on any of them.

3.9) How do I run 'passwd', 'ftp', 'telnet', 'tip' and other interactive
programs from a shell script or in the background?

These programs expect a terminal interface. Shells makes no
special provisions to provide one. Hence, such programs cannot
be automated in shell scripts.

The 'expect' program provides a programmable terminal interface
for automating interaction with such programs. The following
expect script is an example of a non-interactive version of
passwd(1).

# username is passed as 1st arg, password as 2nd
set password [index $argv 2]
spawn passwd [index $argv 1]
expect "*password:"
send "$password\r"
expect "*password:"
send "$password\r"
expect eof

expect can partially automate interaction which is especially
useful for telnet, rlogin, debuggers or other programs that have
no built-in command language. The distribution provides an
example script to rerun rogue until a good starting configuration
appears. Then, control is given back to the user to enjoy the game.

Fortunately some programs have been written to manage the
connection to a pseudo-tty so that you can run these sorts of
programs in a script.

To get expect, email "send pub/expect/expect.shar.Z" to
lib...@cme.nist.gov or anonymous ftp same from
durer.cme.nist.gov.

Another solution is provided by the pty 4.0 program, which runs a
program under a pseudo-tty session and was posted to
comp.sources.unix, volume 25. A pty-based solution using named
pipes to do the same as the above might look like this:

#!/bin/sh
/etc/mknod out.$$ p; exec 2>&1
( exec 4<out.$$; rm -f out.$$
<&4 waitfor 'password:'
echo "$2"
<&4 waitfor 'password:'
echo "$2"
<&4 cat >/dev/null
) | ( pty passwd "$1" >out.$$ )

Here, 'waitfor' is a simple C program that searches for
its argument in the input, character by character.

A simpler pty solution (which has the drawback of not
synchronizing properly with the passwd program) is

#!/bin/sh
( sleep 5; echo "$2"; sleep 5; echo "$2") | pty passwd "$1"

3.10) How do I find out the process ID of a program with a particular
name from inside a shell script or C program?

In a shell script:

There is no utility specifically designed to map between program
names and process IDs. Furthermore, such mappings are often
unreliable, since it's possible for more than one process to have
the same name, and since it's possible for a process to change
its name once it starts running. However, a pipeline like this
can often be used to get a list of processes (owned by you) with
a particular name:

ps ux | awk '/name/ && !/awk/ {print $2}'

You replace "name" with the name of the process for which you are
searching.

The general idea is to parse the output of ps, using awk or grep
or other utilities, to search for the lines with the specified
name on them, and print the PID's for those lines. Note that the
"!/awk/" above prevents the awk process for being listed.

You may have to change the arguments to ps, depending on what
kind of Unix you are using.

In a C program:

Just as there is no utility specifically designed to map between
program names and process IDs, there are no (portable) C library
functions to do it either.

However, some vendors provide functions for reading Kernel
memory; for example, Sun provides the "kvm_" functions, and Data
General provides the "dg_" functions. It may be possible for any
user to use these, or they may only be useable by the super-user
(or a user in group "kmem") if read-access to kernel memory on
your system is restricted. Furthermore, these functions are
often not documented or documented badly, and might change from
release to release.

Some vendors provide a "/proc" filesystem, which appears as a
directory with a bunch of filenames in it. Each filename is a
number, corresponding to a process ID, and you can open the file
and read it to get information about the process. Once again,
access to this may be restricted, and the interface to it may
change from system to system.

If you can't use vendor-specific library functions, and you
don't have /proc, and you still want to do this completely
in C, you
are going to have to do the grovelling through kernel memory
yourself. For a good example of how to do this on many systems,
see the sources to "ofiles", available in the comp.sources.unix
archives. (A package named "kstuff" to help with kernel
grovelling was posted to alt.sources in May 1991 and is also
available via anonymous ftp as
usenet/alt.sources/articles/{329{6,7,8,9},330{0,1}}.Z from
wuarchive.wustl.edu.)

3.11) How do I check the exit status of a remote command
executed via "rsh" ?

This doesn't work:

rsh some-machine some-crummy-command || echo "Command failed"

The exit status of 'rsh' is 0 (success) if the rsh program
itself completed successfully, which probably isn't what
you wanted.

If you want to check on the exit status of the remote program,
you can try using Maarten Litmaath's 'ersh' script, which was
posted to alt.sources in January, 1991. ersh is a shell script
that calls rsh, arranges for the remote machine to echo the
status of the command after it completes, and exits with that
status.

3.12) Is it possible to pass shell variable settings into an awk program?

There are two different ways to do this. The first involves
simply expanding the variable where it is needed in the program.
For example, to get a list of all ttys you're using:

who | awk '/^'"$USER"'/ { print $2 }' (1)

Single quotes are usually used to enclose awk programs because
the character '$' is often used in them, and '$' will be
interpreted by the shell if enclosed inside double quotes, but
not if enclosed inside single quotes. In this case, we *want*
the '$' in "$USER" to be interpreted by the shell, so we close
the single quotes and then put the "$USER" inside double quotes.
Note that there are no spaces in any of that, so the shell will
see it all as one argument. Note, further, that the double
quotes probably aren't necessary in this particular case (i.e. we
could have done

who | awk '/^'$USER'/ { print $2 }' (2)

), but they should be included nevertheless because they are
necessary when the shell variable in question contains special
characters or spaces.

The second way to pass variable settings into awk is to use an
often undocumented feature of awk which allows variable settings
to be specified as "fake file names" on the command line. For
example:

who | awk '$1 == user { print $2 }' user="$USER" - (3)

Variable settings take effect when they are encountered on the
command line, so, for example, you could instruct awk on how to
behave for different files using this technique. For example:

awk '{ program that depends on s }' s=1 file1 s=0 file2 (4)

Note that some versions of awk will cause variable settings
encountered before any real filenames to take effect before the
BEGIN block is executed, but some won't so neither way should be
relied upon.

Note, further, that when you specify a variable setting, awk
won't automatically read from stdin if no real files are
specified, so you need to add a "-" argument to the end of your
command, as I did at (3) above.

3.13) How do I get rid of zombie processes that persevere?

From: j...@pit-manager.MIT.Edu (Jonathan I. Kamens)
Date: Fri, 17 Jan 92 14:40:09 -0500

Unfortunately, it's impossible to generalize how the death of
child processes should behave, because the exact mechanism varies
over the various flavors of Unix.

First of all, by default, you have to do a wait() for child
processes under ALL flavors of Unix. That is, there is no flavor
of Unix that I know of that will automatically flush child
processes that exit, even if you don't do anything to tell it to
do so.

Second, under some SysV-derived systems, if you do
"signal(SIGCHLD, SIG_IGN)" (well, actually, it may be SIGCLD
instead of SIGCHLD, but most of the newer SysV systems have
"#define SIGCHLD SIGCLD" in the header files), then child
processes will be cleaned up automatically, with no further
effort in your part. The best way to find out if it works at
your site is to try it, although if you are trying to write
portable code, it's a bad idea to rely on this in any case.
Unfortunately, POSIX doesn't allow you to do this; the behavior
of setting the SIGCHLD to SIG_IGN under POSIX is undefined, so
you can't do it if your program is supposed to be
POSIX-compliant.

If you can't use SIG_IGN to force automatic clean-up, then you've
got to write a signal handler to do it. It isn't easy at all to
write a signal handler that does things right on all flavors of
Unix, because of the following inconsistencies:

On some flavors of Unix, the SIGCHLD signal handler is called if
one *or more* children have died. This means that if your signal
handler only does one wait() call, then it won't clean up all of
the children. Fortunately, I believe that all Unix flavors for
which this is the case have available to the programmer the
wait3() call, which allows the WNOHANG option to check whether or
not there are any children waiting to be cleaned up. Therefore,
on any system that has wait3(), your signal handler should call
wait3() over and over again with the WNOHANG option until there
are no children left to clean up.

On SysV-derived systems, SIGCHLD signals are regenerated if there
are child processes still waiting to be cleaned up after you exit
the SIGCHLD signal handler. Therefore, it's safe on most SysV
systems to assume when the signal handler gets called that you
only have to clean up one signal, and assume that the handler
will get called again if there are more to clean up after it
exits.

On older systems, signal handlers are automatically reset to
SIG_DFL when the signal handler gets called. On such systems,
you have to put "signal(SIGCHILD, catcher_func)" (where
"catcher_func" is the name of the handler function) as the first
thing in the signal handler, so that it gets reset.
Unfortunately, there is a race condition which may cause you to
get a SIGCHLD signal and have it ignored between the time your
handler gets called and the time you reset the signal.
Fortunately, newer implementations of signal() don't reset the
handler to SIG_DFL when the handler function is called. To get
around this problem, on systems that do not have wait3() but do
have SIGCLD, you need to reset the signal handler with a call to
signal() after doing at least one wait() within the handler, each
time it is called.

The summary of all this is that on systems that have wait3(), you
should use that and your signal handler should loop, and on
systems that don't, you should have one call to wait() per
invocation of the signal handler.

One more thing -- if you don't want to go through all of this
trouble, there is a portable way to avoid this problem, although
it is somewhat less efficient. Your parent process should fork,
and then wait right there and then for the child process to
terminate. The child process then forks again, giving you a
child and a grandchild. The child exits immediately (and hence
the parent waiting for it notices its death and continues to
work), and the grandchild does whatever the child was originally
supposed to. Since its parent died, it is inherited by init,
which will do whatever waiting is needed. This method is
inefficient because it requires an extra fork, but is pretty much
completely portable.

3.14) How do I get lines from a pipe as they are written instead of only in
larger blocks.

From: j...@pit-manager.MIT.Edu (Jonathan I. Kamens)
Date: Sun, 16 Feb 92 20:59:28 -0500

The stdio library does buffering differently depending on whether
it thinks it's running on a tty. If it thinks it's on a tty, it
does buffering on a per-line basis; if not, it uses a larger
buffer than one line.

If you have the source code to the client whose buffering you
want to disable, you can use setbuf() or setvbuf() to change the
buffering.

If not, the best you can do is try to convince the program that
it's running on a tty by running it under a pty, e.g. by using
the "pty" program mentioned in question 3.9.

--
Ted Timar - tmat...@sunee.uwaterloo.ca
Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3

-----------------------------

From: "Hetland, Thor Henning 7-93" <ART...@gribb.hsr.no>
Subject: Device driver (I/O)
Date: 9 Oct 92 08:46:21 GMT
Sender: ne...@hsr.no
To: info...@sem.brl.mil


Do anyone out there have an C-example of an I/O device driver? We are doing
one right now, and would like to check out some tricks..

Please e-mail any responce.

TSM.

-----------------------------

From: Alan Yasutovich <ya...@ll.mit.edu>
Subject: Printing to a serial postscript printer hangs printer.
Date: 9 Oct 92 12:11:26 GMT
Sender: ne...@ll.mit.edu
To: info...@sem.brl.mil


I have a xyplex terminal server on the network. Xyplex
provides a printer of.

The print to the ASCII printer has always worked.

When I send postscript, the "busy light" comes on and stays
on. Also, there are 2 ways to do it. "By hand" to the filter,
and lpr.

Doing it by hand prints successfully, but the light continues
to flash. using lpr gives no printout, and hangs the printer
for a power-down reset.

I believe at least that there is some kind of bogus character
there.

It was suggested that I put a cntrl D as the last character
in the file. This made no difference.

Any ideas?

--
Alan Yasutovich
"inquiring (and nosey) minds WANT TO KNOW!!!"
I can remember when "safe sex" meant having a padded headboard!!
Tick Tock.....Tick Tock......Tick Tock .....Tick Tock......

-----------------------------

From: Harley Davis <da...@passy.ilog.fr>
Subject: When to use libcurses
Date: 9 Oct 92 16:53:53 GMT
Sender: ne...@ilog.fr
To: info...@sem.brl.mil


Is there any reason not to use the curses library for controlling a
terminal within a portable program? It seems to exist on all Unices
of interest as well as VMS, yet GNU Emacs does not seem to use it in
most cases. This makes me wonder if there is some problem with it.

-- Harley Davis
--

------------------------------------------------------------------------------
nom: Harley Davis ILOG S.A.
net: da...@ilog.fr 2 Avenue Gallie'ni, BP 85
tel: (33 1) 46 63 66 66 94253 Gentilly Cedex, France

-----------------------------

From: Sarah Skovronsky <star...@stein.u.washington.edu>
Subject: .signatures, fortune files, etc.
Date: 9 Oct 92 21:20:10 GMT
Sender: USENET News System <ne...@u.washington.edu>
To: info...@sem.brl.mil

I'd like to set up a .signature that would include a randomly-chosen quote
each time I used it. Or, failing that, set up my own fortune file so I
can at least have random sayings, if not imbedded in the signature. Does
anyone know how I could go about doing this?

--
Please note new address
**********************************vvvvvvvvvvvvvvvvvvvvvvvvv*************
* Sarah Skovronsky star...@u.washington.edu *
* "Sample my FIST, you community theater reject!" --TV's Frank, MST3K *
**********fnord!********furrfu!********hi-keeba!********meep!***********

-----------------------------

From: Tim McDonough CSC <mcd...@nosc.mil>
Subject: Problem with dd and tar file on exabyte
Date: 9 Oct 92 21:22:43 GMT
Sender: Network News <use...@nosc.mil>
To: info...@sem.brl.mil

Greetings
I want to copy a tar file from one exabyte tape to another.
I've been using dd/cpio to copy the single tar file
with little luck. I've tried ibs/bs=8196 . Tar has no
problem extracting the files. Using a SPARCstation 1+ 4.1.2

fizzle 18> /usr/bin/dd if=/dev/rst9 files=1 of=/dev/rst6
st1: Error for command 'read', Error Level: 'Fatal'
Block: 0 File Number: 0
Sense Key: No Additional Sense
Incorrect Length Indicator Set
dd: read: I/O error
0+0 records in
0+0 records out


---
Tim McDonough | The opinions voiced are my own and
Computer Sciences Corp. | do not reflect those of my employer
mcd...@sunspot.nosc.mil | or the Susquehanna Hat Company.

-----------------------------

From: Dave Morgan <dmo...@javelin.sim.es.com>
Subject: Converting comp_t type to something more integerish.
Date: 9 Oct 92 22:15:57 GMT
To: info...@sem.brl.mil


We are trying to track the usage of a software package we have
to determine how many licenses we need. Turning on Sun's accounting
appears to record every invocation of a process, exactly what we need.
I have no problem opening the file /var/adm/pacct and running through
it reading in acct structs. I just can't tell how long the process ran
(elapsed time) since I don't know how to get this elapsed time from comp_t
to something I can use.
I'd use sa, but it doesn't tell me how many of the processes were running
at any given time and how long each session lasted. This is what I need for
license info.

man 5 acct gives:
The type comp_t is a 3 bits base 8 exponent, 13 bit fraction
``floating point'' number.

Any help appreciated...

-Dave
--
-* Dave Morgan System Programmer
dmo...@javelin.sim.es.com Evans & Sutherland Computer Corporation
...uunet!javelin.sim.es.com!dmorgan "Carpedium - Sieze the day"

-----------------------------

From: Marty Collins <mcol...@db.SJF.Novell.COM>
Subject: Re: PC/NFS vs Netware
Date: 9 Oct 92 23:49:53 GMT
Sender: The Netnews Manager <ne...@novell.com>
Nntp-Posting-Host: db.sjf.novell.com
X-Newsreader: Tin 1.1 PL4
To: info...@sem.brl.mil

kum...@beach.csulb.edu (ANDY KUMEDA) writes:
: Sorry if this topic has been brought up before...


:
: The question: Should we use Sun's PC/NFS or Novell's Netware?!?
: I mainly would like a summary of Pros and Cons between the two.

You are asking about comparing apples and oranges.

Are you heavily vested in DOS workstations or UNIX workstations?

If you are vested heavier in one side then that shows which platform
to use.

If the type of machines is even then you need to ask yourself do you
need connectivity between both worlds?

If so then you could run Netware on a central server that would allow
DOS clients access to file and print services. Then you could either
by Netware NFS that would allow UNIX users access to the same Netware
file and print services. The two products together would be
$4,995 for Netware NFS and $4,995 for 50 user version of Netware 3.11.

Or you could get Portable Netware or Netware for Sun for your Sun.
I don't know the cost of this particular product.

If you wanted to load PC-NFS on Dos workstation and have seemless connectivity
to both Netware and Sun at the same time it can be done for a resonable
memory hit. Running both the Netware shell and PC-NFS shell with the
correct modules will run you about 70-100K with reasonable memory management.

Then you will have the overhead of running the NFS protocol right from your
workstation compared to using a centralized server to be the
middle point between the Dos/Netware and UNix/NFS world.
You must install PC-NFS on all workstations that you want this connectivity
compared to installing NFS on just the Netware server that should have the
high amount of memory and faster processor, hopefully.

:
: Things that should be considered:


: 1) Hardware requirements. (Note: we already have an Ethernet network
: established.)
: a. Server cost/type
: 2) Software requirments.
: a. Server software cost
: b. Client software cost
: 3) Advantages vs Disadvantages between the two
: a. Will the end-user notice any difference?!?
: b. Which is easier to administer?!?
: c. Print capabilities?!?
: d. Misc. (ie other important issues)
:
: If it's of any significance, our site consists of several hundred
: PC's (286's, 386/25, 386/33) all connected by UTP Ethernet.
:
: Please e-mail responses as I do not read all the newsgroups that I
: posted to -- I will summarize later.
:
: Thank you.
:
: Andy Kumeda
: US Naval Weapons Station, Seal Beach
: (310) 594-7114
: kum...@hawk.nwac.sea06.navy.mil
: kum...@csulb.edu

:

--

A woman needs a man like a fish needs a bicycle.

U2
Tryin to throw your
arms around the world.

Marty Collins
Product Support
NOVELL, INC. San Jose, CA.
mcol...@novell.com
1-800-NETWARE

-----------------------------

From: Jim Gasprich <ji...@ocean.rutgers.edu>
Subject: prtvtoc (SVR4) vs. dkinfo (SUN OS 4.1.1)
Keywords: prtvtoc

Date: 10 Oct 92 00:28:23 GMT
To: info...@sem.brl.mil

I am stuck with a couple of OKIstations and their storage devices, I'd like
to move the 600 M drives onto a SUN SPARCstation IPC (SUN OS 4.1.1). What I
need is info (# cyls, etc.) on the OKI drives so that the info can be used
in the SUN's format program.

OKI has since gone belly-up (if you have any of their machines, you would
understand why), so I have no one to pesker on the phone. The OKIs use
SVR4, and we have some feeble manuals from Intel which have helped, but not
enough.

In SUN OS, there is a command called dkinfo, which gives info on a disk, i.e.:
#dkinfo sd0

sd0: Emulex MD21 controller at addr f8800000, unit # 24
1254 cylinders 9 heads 36 sectors/track
a: 16848 sectors (52 cyls)
starting cylinder 0
b: 65448 sectors (202 cyls)
starting cylinder 52
c: 406296 sectors (1254 cyls)
starting cylinder 0
d: No such device or address
e: No such device or address
f: No such device or address
g: 283176 sectors (874 cyls)
starting cylinder 254
h: 40824 sectors (126 cyls)
starting cylinder 1128

In SVR4, there is a command called prtvtoc (print Volume Table of Contents),
which should give me what I want, but alas, does not seem to work. Here's the
lowdown:

# df
/ (/dev/root ): 48872 blocks 46804 files
/proc (/proc ): 0 blocks 143 files
/dev/fd (/dev/fd ): 0 blocks 0 files
/stand (/dev/dsk/c0t0d0sa): 6425 blocks 92 files


/grass (/dev/dsk/c0t1d0s1): 665250 blocks 40822 files

(the last listing is the disk I want info on)

# prtvtoc /dev/rdsk/c0t1d0s1
prtvtoc: device /dev/rdsk/c0t1d0s1 is not a slice 0 device
prtvtoc [-a] [-e] [-p] [-f filename] raw-device

I'm a little lost as to the error message, and the manual does not even give
a listing of the other options.

Any help or clues would be greatly appreciated. Thanks.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Jim Gasprich e-mail: ji...@ocean.rutgers.edu
Research & Support Slave tel: (908) 932-9631
Cook College Remote Sensing Center fax: (908) 932-8644
Rutgers University
PO Box 231
New Brunswick, NJ, O8903 "Du bist mein Gweckman" - Anonymous Fascist
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

-----------------------------

From: "Chris M. Cavers" <cav...@menudo.uh.edu>
Subject: kernel to nonkernel ipc
Date: 10 Oct 92 04:02:26 GMT
Sender: cav...@menudo.uh.edu
To: info...@sem.brl.mil

I would like to have my device driver communicate with a user level process.
The ioctl call is fine for short data transfers (128 or 255 bytes) but
I need to send over several thousand bytes at one time.

My questions are:
a) which method does the kernel use (sockets,message queues,
shared memory w/semaphores)
b) If I want to send messages from kernel (e.g. device driver) to
user level processes, is it ok to use message queues?

-----------------------------

From: "Chris M. Cavers" <cav...@menudo.uh.edu>
Subject: rn
Date: 10 Oct 92 04:05:33 GMT
Sender: cav...@menudo.uh.edu
To: info...@sem.brl.mil

How do I kill the signtures from message when I use rn.
I couldn't find this in the manual pages.

-----------------------------

From: David Fox <bbs.b...@goonsquad.spies.com>
Subject: PKZIP for unix? (pkzip version 1.10)
Date: 10 Oct 92 05:35:46 GMT
Sender: dae...@ucbvax.berkeley.edu
To: info...@sem.brl.mil

Hi. I've acquired a version of zip/unzip for unix (BSD) that works
but it's compatible with version 1.93a (DOS), and not 1.10 (DOS),
which most/all DOS-oriented BBSes use. Thus, I need to find where
I can get a version that's compatible.

Please email with ftp sites where I can get these. I think it's
unzip 5.0?

REGI's

unread,
Oct 15, 1992, 12:26:40 PM10/15/92
to
>X-Envelope-to: info...@sem.brl.mil
>X-VMS-To: IN::" info...@sem.brl.mil"

1
13-OCT-1992 03:09:42.67
1 00:00:00.00
14-OCT-1992 03:09:42.67
info-uni...@sem.brl.mil
raf...@obelix.cica.es

Received: from SEM.BRL.MIL by ESEVVX.CICA.ES ; 10-OCT-1992 03:08:18.93
Received: from SEM.BRL.MIL by SEM.BRL.MIL id ab00943; 9 Oct 92 18:59 EDT
Received: from sem.brl.mil by SEM.BRL.MIL id aa27120; 9 Oct 92 15:15 EDT
Date: Fri, 09 Oct 92 15:15:38 EST


From: The Moderator (Mike Muuss) <Info-Uni...@BRL.MIL>
To: INFO...@BRL.MIL
Reply-To: INFO...@BRL.MIL

Subject: INFO-UNIX Digest V16#033
Message-ID: <921009151...@SEM.BRL.MIL>

INFO-UNIX Digest Fri, 09 Oct 1992 V16#033

Today's Topics:
nslookup set-up
Re: telnet & packet size
Re: Restricting access to display (AIX 3.2)
Re: Logon detection


Re: Porting under UNIX (Was: Re: NT Under SCO Unix)

Re: Remote Printing from HP to BSD systems

Re: Hidden (invisible) files


Re: NT Under SCO Unix

MIT X11R5 problem with SUID & SGID...solved!
How to get the UNIX(or similar) source code?
Re: Unix Fax Servers
Automating a Telnet Session
Re: Automating a Telnet Session
UNIX physical memory control
Re: IS UNIX DEAD?
more lines
How to make a print filter
Backup Solutions and Recommendations
Need Help!


Re: Man page naming convention

-----------------------------------------------------------------

From: Michael Turok 4-1235 x2628 <mtu...@cvbnet.prime.com>
Subject: nslookup set-up
Date: 6 Oct 92 00:12:56 GMT
Sender: post...@cvbnetprime.com
To: info...@sem.brl.mil


Hello, netters:

Got a question for you: how does one set up 'nslookup' to work
correctly ?
Obviously, I'd like to use 'nslookup' to look up Internet addresses of
archive servers when only the site name is given.

Here's a log of my 'naive' usage of 'nslookup'

mturok/Harley>nslookup
*** Can't find initialize address for server : Timed out
Default Server: localhost
Address: 127.0.0.1

> rutgers.edu
Server: localhost
Address: 127.0.0.1

*** Request to localhost timed-out
>exit
mturok/Harley>


Note: the following line exists in my /etc/hosts file
127.0.0.1 localhost loghost
And the 'localhost' is indeed up and running.
Also I don't have a /etc/resolv.conf file, which should be OK
according to man page.

What do I do wrong?

Any hints/explanations from you would be greatly appreciated.

-------------
Michael Turok

E-Mail: mtu...@harley.prime.com
Voice Mail: (617) 275-1800 x2628
Mail: ComputerVision MS 4-1, 201 Burlington Rd,
Bedford, MA 01730

-----------------------------

From: Joe Touch <to...@isi.edu>
Subject: Re: telnet & packet size
Date: 6 Oct 92 18:13:08 GMT
Sender: ne...@isi.edu
To: info...@sem.brl.mil

In article <1992Oct06.1...@bnr.ca> jo...@nnshh127.uucp (John Hawkins) writes:

>From: jo...@nnshh127.uucp (John Hawkins)
>Newsgroups: comp.sys.mac.apps,comp.unix.questions
>Date: 6 Oct 92 14:36:33 GMT
>Organization: Northern Telecom Inc., Nashville, TN

>Environment: macintosh using mac241 or NCSA telnet or Brown connecting to
host HP9000/832 or HP9000/817.

>Problem: > One character per packet from (mac) not host via the
wide-area-network. With ten users on the system they take up
~60% of capacity of WAN. > > >

>Question: > Is there anyway to configure either the drivers of tcp/ip
or the telnet software itself (mac side) to only send a packet
when a newline or tab character is input?
This would dramatically reduce the # of packets
and would fit the application nicely!

The application is made to run on any 'dumb' terminal.
Yes I've thought about client/server and distributed,
but this would be a quick invisible solution to a
system that is already in place.

In order to aggregate the packets, you'd need some kind of
*line-oriented* terminal, i.e., NOT a 'dumb' terminal, but an
'intelligent' one, e.g., the IBM series (the 4-digit numbered ones,
I don't remember the number, but 3870 or something like that seems
close).

The idea is that in order to group the characters and send them out
only when a linefeed is generated, you have to have the terminal take
care of everything that happens before the linefeed. That includes
backspace erasing, and any other editing and echo. Similarly, more
complex features (such as command-line completion) are nearly
impossible, because the terminal doesn't know what the commands are.

I hope this is useful.

Joe Touch
Computer Scientist/ protocols, high-performance networks
USC/Information Sciences Institute
to...@isi.edu

-----------------------------

From: Joe Touch <to...@isi.edu>
Subject: Re: telnet & packet size
Date: 6 Oct 92 18:16:39 GMT
Sender: ne...@isi.edu
To: info...@sem.brl.mil

To:

-----------------------------

From: Joe Touch <to...@isi.edu>
Subject: Re: telnet & packet size
Date: 6 Oct 92 18:30:44 GMT
Sender: ne...@isi.edu
To: info...@sem.brl.mil

In article <22...@venera.isi.edu> to...@ISI.EDU (Joe Touch) writes:

(to follow up on my own post ;-} )

From: to...@ISI.EDU (Joe Touch)
Date: 6 Oct 92 18:13:08 GMT
References: <1992Oct06.1...@bnr.ca>
Organization: USC-ISI
In article <1992Oct06.1...@bnr.ca> jo...@nnshh127.uucp (John Hawkins) writes:

>Problem: > One character per packet from (mac) not host via the
wide-area-network. With ten users on the system they take up ~60% of capacity of WAN. > > >

>Question: > Is there anyway to configure either the drivers of tcp/ip
or the telnet software itself (mac side) to only send a packet
when a newline or tab character is input?
The application is made to run on any 'dumb' terminal.

In order to aggregate the packets, you'd need some kind of
*line-oriented* terminal, i.e., NOT a 'dumb' terminal, but an
'intelligent' one, e.g., the IBM series (the 4-digit numbered ones,
I don't remember the number, but 3870 or something like that seems
close).

Found it - it's an IBM 3270.

The idea is that in order to group the characters and send them out
only when a linefeed is generated, you have to have the terminal take
care of everything that happens before the linefeed. That includes
backspace erasing, and any other editing and echo. Similarly, more
complex features (such as command-line completion) are nearly
impossible, because the terminal doesn't know what the commands are.

I forgot to mention, this line-oriented mode IS part of the existing
TELNET standard, although only as elective, i.e., a 'standard'
implementation can omit them. (sort of defeats the purpose of a
standard, huh? :-} )

The two options of interest are the TOPT-DATA Data Terminal Entry
option (Option #20, Proposed, Elective, RFC 1043), and the TOPT-3270
Telnet 3270 regime (Option #29, Proposed, Elective, RFC 1041). Both
are versions of line-editing terminals, designed to overcome the
network overloading of character-based 'dumb' terminals you have
observed.

The status of these options is described in the IAB Official Protocol
Standards status RFC 1360.

These RFC's are "request for comments" memos of the Internet
Activities Board. On-line access to them is described in any general
telecommunications text, such as Tannenbaum's "Computer Networks",
Rose's "The Simple Book", Stallings' "Handbook of Computer
Communications Standards Vol. 3", etc.

Again, I hope this helps. Unfortunatly, it may mean you need a smarter
terminal.

Joe Touch
Computer Scientist / protocols, high-performance networks
USC/ Information Sciences Institute
to...@isi.edu

-----------------------------

From: Drew Eckhardt <dr...@juliet.cs.colorado.edu>
Subject: Re: Restricting access to display (AIX 3.2)
Date: 7 Oct 92 00:17:48 GMT
Sender: The Daily Planet <ne...@colorado.edu>
Nntp-Posting-Host: juliet.cs.colorado.edu
To: info...@sem.brl.mil

In article <1992Oct6.1...@ncsu.edu> rab...@eos.ncsu.edu (RODNEY ALLEN BOLES) writes:
>
>I have an RS/6000 that is running AIX3.2 (don't know if this matters
>or not for this question).
>
>I am running at display:0 at my workstation. It is possible
>(and needed) for other users to rlogin to my machine.
>I've noticed when a user does an xlock (and other programs)
>that my display is locked (or otherwise affected depending on
>program).
>
>Is there a way to restrict this and still allow access to my machine??

Yes - Xauthorization.

>It is not an xhost access problem.

No. xhost only works on a per machine basis.

With Xauthorization, the server has a unique key. If a client tries
to connect to the server from a machine that is not in the host access
list (this includes the local host), keys are compared and if they don't
match, no connection.

Your copy of the key is kept in a file that is read/write you and
root only, the server's copy is in /tmp, and is read/write root only.
So, unless you mail some one the key, they won't be able to find it
out to connect to your Xserver.

Keys can be manually created, although xdm is probably more convienient.
Xdm creates a unique key for each login session, and automatically
"does the right thing" with your Xauthority file (with keys for
all of the displays you are logged into).

Note that IBM sabotaged the Xserver bundled with AIX3.2, so it has to
be run with a HFT as a controlling terminal. This means that it
doesn't work with the stock xdm, and you need to hack xdm or
use a wrapper for the Xserver. I chose the later - the wrapper
follows. Simply change the line in the Xservers file pointed to
by the xdm config file to point to the wrapper, instead of the "real"
Xserver under /usr/lpp/X11/bin.

-- cut
/*
* X wrapper for AIX 3.2 server
*
* The Xserver needs to run with a hft as a controlling tty.
* This wrapper does just that.
*/

#include <stdio.h>
#include <sys/file.h>
#include <sys/ioctl.h>

/*
* I tried moving the server to /usr/lpp/X11/bin/X.real,
* things didn't work because of some shared library problem.
*/

#ifndef SERVER
#define SERVER "/usr/lpp/X11/bin/X"
#endif

/*
* /dev/hft means the "first free virtual terminal".
*/

#ifndef HFT
#define HFT "/dev/hft"
#endif

void main (int argc, char **argv, char **envp) {
int pgrp, f;

/*
* First, we must disconnect from the controlling terminal
* (if there is one)
*/

if ((f = open("/dev/tty", O_WRONLY)) >= 0) {

if (ioctl(f, TIOCNOTTY, 0) < 0) {
fprintf(stderr, "%s : TIOCNOTTY ioctl failed ",
argv[0]);
perror("");
exit(1);
}

close(f);
}

close(0);
close(1);

/*
* Now, we get our own process group, and session. This lets
* us associate with a new controlling tty.
*/

if ((pgrp = setpgrp()) < 0) {
fprintf(stderr, "%s : setpgrp() failed ", argv[0]);
perror("");
exit(1);
}

/*
* Since we have no controlling tty, and the HFT we want
* has no session / pgrp associated with it, when we open it,
* it will become our controlling tty.
*/

if (open(HFT, O_RDONLY, 0) < 0 ||
open(HFT, O_WRONLY, 0) < 0) {
fprintf(stderr, "%s : open failed on %s ", argv[0], HFT);
perror("");
exit(1);
}

execv(SERVER, argv, envp);
fprintf(stderr, "%s : exec %s failed ", argv[0], SERVER);
perror("");
exit(1);
}


--
Microsoft is responsible for propogating the evils it calls DOS and Windows,
IBM for AIX (appropriately called Aches by those having to administer it), but
marketing's sins don't come close to those of legal departments.
Boycott AT&T for their absurd anti-BSDI lawsuit.

-----------------------------

From: Bob Stockler <ro...@trebor.uucp>
Subject: Re: Logon detection
Date: 7 Oct 92 02:21:41 GMT
To: info...@sem.brl.mil

Tom Christiansen <tch...@convex.COM> writes:

>From the keyboard of wei...@pecan.cns.udel.edu:
>[81 lines of C code deleted.]

>I have never come to understand why people continually
>want to program in assembler when a few lines of C will do.

>I have never come to understand why people continually
>want to program in C when a few lines of sh will do.

>In this case, a few lines (or fewer!) of sh will do.
>Why make a binary that takes 80 lines to express the
>same concept, doesn't use existing tools, and requires
>that a separate binary be installed on all your architectures,
>using up vastly greater amounts of disk space?

Maybe they came from a messydos background ? ? ?

-----------------------------

From: Kevin Broadey <ke...@edscom.demon.co.uk>
Subject: Re: Porting under UNIX (Was: Re: NT Under SCO Unix)
Date: 7 Oct 92 09:25:15 GMT
Sender: Kevin Broadey <ke...@edscom.demon.co.uk>
X-Disclaimer: These opinions are mine: others available on request.
To: info...@sem.brl.mil

>>>>> In article <KETIL.92O...@ugle.ii.uib.no>, "Ketil" ==
>>>>> ke...@ugle.ii.uib.no (Ketil M. Malde) writes:

Ketil> Sure, UNIX versions varies, but remember that if Unix had been
Ketil> produced by *one* vendor from the start, it wouldn't have become
Ketil> what it is today.

Is that a glowing endorsement or a damning criticism?

-----------------------------

From: Keith Bedford <kei...@hemel.bull.co.uk>
Subject: Re: Porting under UNIX (Was: Re: NT Under SCO Unix)
Date: 7 Oct 92 11:37:35 GMT
Sender: @uk03.bull.co.uk:
MMDF-Warning: Parse error in original version of preceding line at BRL.MIL

Nntp-Posting-Host: brno
To: info...@sem.brl.mil

ke...@ugle.ii.uib.no (Ketil M. Malde) writes:


>Btw, how would you go about without ifdefs? Say you want to port NT
>code (or whatever) to a different architecture. Now: how will you
>cope with little- or bigendianness, integer size (32bit, 64bit, or
>whatever), and probably several other HARDware dependencies. And we
>haven't even touched multiprocessing systems (which seems to be the
>future) yet.

The best way (IMHO) is to extract all portability issues into header files
which define macros to achieve the desired aim. This produces clean
readable source files. The header files can either use #ifdef to select
between platforms or different header files can be produced for each
platform (easier to read and create, harder to maintain).


>--
> = Ketil Malde In real life: ke...@ii.uib.no =
==============================================================================
Keith Bedford keith....@uk03.bull.co.uk

-----------------------------

From: Pete Hardie <pha...@nastar.uucp>
Subject: Re: Porting under UNIX (Was: Re: NT Under SCO Unix)

Date: 7 Oct 92 14:41:39 GMT
To: info...@sem.brl.mil

In article <KETIL.92O...@ugle.ii.uib.no> ke...@ii.uib.no writes:
>Well, maybe it's difficult to write portable code under Unix, I
>haven't really tried, but I have ported (compiled) quite a few
>applications to our systems. And I find that there usually is very
>little difficulty involved.
>

>Btw, how would you go about without ifdefs? Say you want to port NT
>code (or whatever) to a different architecture. Now: how will you
>cope with little- or bigendianness, integer size (32bit, 64bit, or
>whatever), and probably several other HARDware dependencies. And we
>haven't even touched multiprocessing systems (which seems to be the
>future) yet.

It seems to me that the biggest advantage of #ifdef is that the unused code
does not get compiled into the object file, preventing huge sizes. Most of
the functionality of #ifdef could be duplicated by selective sed'ing of header
files in the configuration, since a majority of the changes are either a)
function name/parameter differences or b) endian/size differences, and those
can usually be *compiled* w/o error on any machine, whether or not they can
*run* correctly.

--
Pete Hardie: phardie@nastar (voice) (404) 497-0101
Digital Transmission Systems, Inc., Duluth GA
Member, DTS Dart Team | cat * | egrep -v "signature virus|infection"
Position: Goalie |

-----------------------------

From: Randall Atkinson <atki...@itd.nrl.navy.mil>
Subject: Re: Remote Printing from HP to BSD systems

Date: 7 Oct 92 12:22:12 GMT
Sender: use...@ra.nrl.navy.mil
To: info...@sem.brl.mil

In article <1992Oct06....@news.mentorg.com> ste...@hpc.mentorg.com (Steve Jumonville) writes:
>
>By the way, run 'sam' in an 'hpterm' window if you want access to function keys.

Not necessary, sam(1) also works just fine in an xterm or on any vt100 emulator.

-----------------------------

From: Adam Andrews <a...@rexago8.uucp>
Subject: Re: Hidden (invisible) files
Date: 7 Oct 92 12:55:58 GMT
To: info...@sem.brl.mil

st...@ee.rochester.edu (Chuck S.) writes:

>do what has to do here
>files can be name " " or " " or " " or " .." ect

The disadvantage here is that the filenames will still be detectable, though
not visible. 'ls' will show a blank line; 'ls -x' will contain a blank
field, 'ls -l' will contain a line showing permissions, ownership, size, etc
but with no filename.

Preceding your file or dirname with '.' will at least ensure that the file
will only be detectable using 'ls -a'.

--
Adam Andrews "When the going gets weird, we get even weirder."
uunet!rexago8!aa or a...@rexago8.UUCP e-mail only to a...@summitis.com

-----------------------------

From: Geir Engebakken <ge...@fdmetd.uucp>
Subject: Re: Hidden (invisible) files
Date: 7 Oct 92 16:36:24 GMT
To: info...@sem.brl.mil

In article <1992Oct6.1...@ee.rochester.edu>, st...@ee.rochester.edu (Chuck S.) writes:
> Everyone says use .filename or .directory how about
> chmod og-rw filename ;this keeps people out
> first mkdir ." " which is a directory call space
> chmod og-rw ." "
> cd ." "
> do what has to do here
>
> files can be name " " or " " or " " or " .." ect

Files called " " etc. will be visible in an ls listing as blank lines,
so you will know there is a file there called _something_. One might
just use 'od -c' on the directory file to find out how many SPC'es there
are or get the unprintable characters as TAB printed!

It's better to call the file "<whatever the terminals up-arrow is>
e.g. "^[[A" for vt100 terminals. This will effectively hide the
file. Of course this will only work in a homogenuos environment with all
terminals of same type!

Geir


If you

>
> chuck
>
> --
> ==============================================================================
> = Thanks for Whatever needed to be written to the net!
> = There's no place like internet!!!
> = Chuck Streb internet st...@galaxy.ee.rochester.edu

--
Geir Engebakken, Fellesdata a.s, P.O. Box 248, 0212 OSLO 2, NORWAY
Phone : +47 2 52 80 44 Fax : +47 2 52 85 10
E-mail : ...!mcsun!nuug!fdmetd!geir or ge...@fdmetd.uucp
<The opinions expressed, if any, do not represent Fellesdata a.s>

-----------------------------

From: IT Manager <j...@tiamat.fsc.com>
Subject: Re: NT Under SCO Unix

Date: 7 Oct 92 14:35:40 GMT
Followup-To: comp.unix.dos-under-unix,comp.os.ms-windows.programmer.win32,comp.unix.questions
To: info...@sem.brl.mil

In article <1992Oct04....@ksmith.uucp>, ke...@ksmith.uucp (Keith Smith) writes:
> I knew it all along. I'm f*cking nuts. (Not in my right mind). I kinda
> like the SPEED and simplicity of the text based interface. In fact even
> though I can use X or even windows at work I don't. I just don't ever
> SEE any business apps running 90% graphics. Hey, Don't get me wrong.
> If you are doing CAD or Desktop Publishing you NEED those capabilities.
> But the average user on my Systems can't even follow the concept of an
> SCO multiscreen. Full use of windows would just blow them away, like as
> in forget it.

I used to think this also. A few months ago we installed 3
X-terminals for non-technical users (they are, however, educated
people, so we're not talking illiterates here) and they have really
caught on, so I would not discount the advantages of a window based
system.

However, I will still side with Keith that support for character based
applications is absolutely necessary. Even on the X-terminals, most
of the programs being used are running in 'xterm' windows in character
mode. This is for two reasons: 1) most of the programs are ones we
wrote, so there's no time or money to go back and change them all to
direct X apps, and 2) the programs we actually bought (e.g. WP, 1-2-3,
etc) are just now coming out with X-based versions on our platforms
and the upgrades aren't going to be free, so it will be a while before
we can affordt o upgrade.

So, while I would not give up my Xwindows work environment for
anything, I still argue for the preservation of character interfaces,
since you can always integrate character into graphical, whereas the
reverse is quite tedious.
-------------
James B. O'Connor j...@tiamat.fsc.com
Information Technology Manager voice 615/821-4022 x651
Ahlstrom Filtration, Inc. fax 615/821-0616
=========
"Anyone who is capable of getting themselves made President,
should, on no account, be allowed to do the job."
Douglas Adams, _The Restaurant at the End of the Universe_

-----------------------------

From: Jeff Veiss - Staff <ve...@cbmvax.commodore.com>
Subject: MIT X11R5 problem with SUID & SGID...solved!
Date: 7 Oct 92 15:48:27 GMT
To: info...@sem.brl.mil


Much thanks to all the people for responding to my news posting about
SUID and SGID programs that use shared libraries.

See the article with the same subject "Re: MIT X11R5 problem with SUID & SGID"
posted by ke...@nmt.edu (kelly) under comp.sys.sun.admin for a summary.
--
-------------------
Jeffrey S. Veiss

Commodore Business Machines
ve...@commodore.com

-----------------------------

From: Bing Zhang <zh...@ms.uky.edu>
Subject: How to get the UNIX(or similar) source code?
Date: 7 Oct 92 16:35:50 GMT
To: info...@sem.brl.mil


I want the UNIX (or similar) source codes for studying OS. Could
anybody tell me how to get them? Please send me a mail at zh...@ms.uky.edu
Thanks a lot.
Bing Zhang

-----------------------------

From: Steve Elias <e...@spdcc.com>
Subject: Re: Unix Fax Servers
Date: 7 Oct 92 18:28:14 GMT
To: info...@sem.brl.mil

those concerned with legalities might want to
note that faxback is a patented thang (IFF the fax is
sent out via a separate phone call.)

it is a combination hardware/software patent,
i don't have the number handy right now, it's been discussed here before.
(comp.dcom.fax, comp.patents)

/eli


In article <1992Oct06.0...@zeos.com! kger...@zeos.com (Ken Germann) writes:
!
!A month or so ago I posted a request for information on
!SCO Unix Voice Fax Back servers. We are considering
!using Faximum Plus for Faxing from Unix. We would have
!all the necessary hardware and software pieces to support
!a Voice Fax Back Server except the Dialogic Voice board and
!the software to drive he voice prompts and telephone keypad
!responses.
!
!
!Anyone who hhas or knows of a company that is experienced with
!writing applications that utilize the Dialoogic Voice Boards
!under SCO Unix can send information to the address below or
!contact me via E-mail.
!
!The last contact that I had was frm Data TTech. I don't have
!their number. I will summarize the information that I find.
!--
!Ken Germann ZZZZ EEEE OO SSS ZEOS International, Ltd.
!sup...@zeos.com INET Z E O O S Technical Support Dept.
!uunet!zeos!support UUCP Z EE O O SS 530 5th Ave N.W.
!800-228-5390 VOICE Z E O O S St. Paul, MN 55112
!612-633-7337 ZZZZ EEEE OO SSS FAX 612-633-4607


--
/* e...@spdcc.com */

-----------------------------

From: Stuart Lynne <s...@wimsey.bc.ca>
Subject: Re: Unix Fax Servers
Date: 7 Oct 92 22:27:43 GMT
To: info...@sem.brl.mil

In article <1992Oct7.1...@spdcc.com> e...@spdcc.com (Steve Elias) writes:
>those concerned with legalities might want to
>note that faxback is a patented thang (IFF the fax is
>sent out via a separate phone call.)
>

>it is a combination hardware/software patent,
>i don't have the number handy right now, it's been discussed here before.
>(comp.dcom.fax, comp.patents)

We'll also note that there are several good examples of the technology
concerned that pre-date the patent application date that should lead to
the patent being thrown out if and when it gets to court.

The patent covers use of signals (i.e. DTMF tones) to control the delivery
of faxes from a computer system. For example, Globefax a service like this

was in place and being offerred commercially in Canada in January of 1988 by
Teleglobe Canda. The patent application date is May 11, 1988.

I've only been peripherally involved so I don't have uptodate details


but it's my understanding that there is currently an industry group that
will be sponsoring a challenge.

--
Stuart Lynne <s...@wimsey.bc.ca> ....................... UNIX Facsimile Software
Wimsey Information Technologies ................... moderator biz.sco.binaries
uucp login:nuucp passwd:nuucp .................. ftp.wimsey.bc.ca:~ftp/ls-lR.Z
PD Software for SCO UNIX .................. ftp.wimsey.bc.ca:~ftp/pub/wimseypd

-----------------------------

From: Harley Hahn <har...@engrhub.ucsb.edu>
Subject: Automating a Telnet Session
Date: 8 Oct 92 06:23:15 GMT
Sender: ne...@hub.ucsb.edu
To: info...@sem.brl.mil

Does anyone have a script that will automate a telnet session?
I am think, in particular, of something to automate
using the U of Mich. Weather Underground service.

Thanks,

Harley Hahn
har...@engrhub.ucsb.edu

-----------------------------

From: Randy Winney <win...@dal.mobil.com>
Subject: Re: Automating a Telnet Session
Date: 8 Oct 92 15:16:58 GMT
Sender: dae...@ucbvax.berkeley.edu
To: info...@sem.brl.mil

In article <59...@ucsbcsl.ucsb.edu>, har...@engrhub.ucsb.edu (Harley Hahn) writes:
|> Does anyone have a script that will automate a telnet session?
|> I am think, in particular, of something to automate
|> using the U of Mich. Weather Underground service.
|>
|> Thanks,
|>
|> Harley Hahn
|> har...@engrhub.ucsb.edu
|>

You need "expect"!
Read
"expect:Scripts for Controlling Interactive Processes"
Computing Systems, Spring 1991 (published by the ACM)

Get it from
durer.cme.nist.gov in pub/expect/expect.shar.Z

--
Randy Winney win...@dal.mobil.com
Mobil Exploration & Producing Technology Center
Dallas, Texas

-----------------------------

From: Graham Hausler <hau...@aldetec.oz.au>
Subject: UNIX physical memory control
Date: 8 Oct 92 08:45:53 GMT
To: info...@sem.brl.mil

I require some information concerning device drivers and UNIX memory
manipulation.

I am developing a VME device driver on a MVME187 System V/88 system (R3V7)
and wish to map some of the physical memory to the VME space. I have had
a look at the device driver documentation and cannot see how I can 'remove'
pages of UNIX physical memory from the system so I can use it on the VME
bus. Am I wrong in thinking that a device driver cannot lock/reserve physical
memory from the UNIX free memory lists ? Alternatively, I have seen
reference to the device /dev/kmem (and /dev/mem ??) at various times, does
this device allow me to modify the physical memory available to UNIX ? If so,
where do I obtain information on controlling/accessing this device ? Are
there any other alternatives ?

Please email any responses directly, I will post a summary if requested.

Thanks
Graham Hausler.

--
Internet: hau...@aldetec.oz.au --> GEMCO, Perth, Australia.

-----------------------------

From: Robert Bashford <ro...@maths.tcd.ie>
Subject: Re: IS UNIX DEAD?
Date: 8 Oct 92 12:48:10 GMT
To: info...@sem.brl.mil

dans...@Autodesk.COM (Daniel Smith) writes:
>act together. I'm going to slant my future learning efforts towards NT.

> Daniel Smith, Autodesk, Sausalito, California, (415) 332-2344 x 2580

pardon me for asking but WTF is NT?

______ ____ ____ ____
| __ | / \ | | | |
| <| || | |---< |---< @salmon.maths.tcd.ie
|__|\__| \____/ |____||____|...

-----------------------------

From: "Michael G. Bruce" <mu...@winton.uucp>
Subject: Re: IS UNIX DEAD?

Date: 8 Oct 92 15:22:57 GMT
NNTP-Posting-Host: winton.wpi.edu
To: info...@sem.brl.mil

In article <1992Oct8.1...@maths.tcd.ie> ro...@maths.tcd.ie (Robert Bashford) writes:
>pardon me for asking but WTF is NT?
>

A figment of Bill Gates' mind... ;)
(flames/cheers welcome)


--
Michael G. Bruce - mu...@wpi.wpi.edu - Computer Science '94 |
Sun System Adminstrator - Electrical/Computer Engineering Dept -- + --
AK211 - Computational Fields Laboratory |
***---***---***---***---***---***---***---***---***---***--*** |

-----------------------------

From: Pasi Myllym{ki <csp...@uta.fi>
Subject: more lines
Date: 8 Oct 92 14:21:30 GMT
To: info...@sem.brl.mil

When I take a session from my home-PC by a modem to unix computer I have
some problems with numbers of lines on the screen.
If I use for example emacs or readnews I have "only" 25 lines, and normally
there are 50 lines on the screen.
Are there too much lines on my homecomputer's screen?

-Pasi
--
IIIIIIIIIIIIIILIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
Pasi Myllymaki | Tappara saa muuten takkiinsa seuraavassa matsissa!
csp...@uta.fi |

-----------------------------

From: sea...@engr.wisc.edu
Subject: How to make a print filter
Date: 8 Oct 92 14:42:55 GMT
To: info...@sem.brl.mil



We have a networked laserwriter in our department. I want to enable printing to
it from the Unix machines. The problem is that the printer has a cut sheet
feeder attached to it that requres a ps prep header on the file being printed.

WHat's the best way (using lpr) to attach a prep file on to the head of a ps
docuemnt? Is there extensions in lpr that will do this automatically?

Thanks,
Steve

-----------------------------

From: "Syd M. Farber" <SYD.F...@office.wang.com>
Subject: Backup Solutions and Recommendations
Date: 8 Oct 92 15:32:47 GMT
Sender: ne...@wang.com
To: info...@sem.brl.mil

We are currently planning our backup strategy for RS6000. We are planning to
do a MKSYSB backup once a week, and then do incremental backups daily using
the BACKUP with inode command. Has anyone tried this solution and found any
problems that we should be aware of before implementation? We are concerned
with restoring files which are dynamically linked using the backup by inode
method.
Is there another solution that is more feasable? Thank you.

Please email your information or recommendations.
Syd.F...@office.wang.com

-----------------------------

From: Jia Sheng <she...@acf3.nyu.edu>
Subject: Need Help!
Keywords: sleep, help
Date: 8 Oct 92 16:54:01 GMT
Sender: Notes Person <no...@cmcl2.nyu.edu>
Nntp-Posting-Host: acf3.nyu.edu
To: info...@sem.brl.mil

Our group has an IBM RS6k540, there is a guy from outside group who
needs to run his job which runs forever(Monte Carlo stuff). For all
sorts reasons I can't kill his job when the machine is very busy. So
I'm searching for a program which may detects a certain process and put
it into sleep and wake it up after certain period.
Anybody can give me a hint how to do it?
--
Jonathan J. Sheng
Theoretical Chemistry, NYU
(212)998-8439

-----------------------------

From: chrome n zinc <jmk4...@uxa.cso.uiuc.edu>
Subject: 'more'ing files that change ownership (during more)
Date: 8 Oct 92 17:54:59 GMT
Sender: Net Noise owner <use...@ux3.cso.uiuc.edu>
To: info...@sem.brl.mil


Dear Great Newsreaders of the World:

Let's say we are in UNIX, in the /dev directory.

We then see a file, say ttyqR, that has root as an owner.

e.g.

crw-rw-rw- # root #,## date time ttyqR

So, we can see that we can read or write to this file.

We then do :

5> more ttyqR

When this is done, again, we can read or write to this file.

The above command does 'execute', but since there isn't anything
happening, nothing is printed.... it 'hangs'.

But, when someone logs in at a later time, the ownership
changes to whoever was assigned that device.

So here is my question: ownership has already been checked,
right?, so I should see whatever flows into the file, right?

I'll admit this question has unwholesome undertones, but
I'd appreciate responses anyway.

Thank you.

jmk4...@uxa.cso.uiuc.edu
.


--

//\/
\/\
/

-----------------------------

From: Tom Christiansen <tch...@convex.com>
Subject: Re: Man page naming convention

Date: 8 Oct 92 18:31:08 GMT
Sender: news access account <use...@neptune.convex.com>
Originator: tch...@pixel.convex.com
Nntp-Posting-Host: pixel.convex.com
X-Disclaimer: This message was written by a user at CONVEX Computer
Corp. The opinions expressed are those of the user and
not necessarily those of CONVEX.
To: info...@sem.brl.mil

From the keyboard of bar...@think.com (Barry Margolin):
:This is the kind of silly question I usually answer, but now I've come up


:with one of my own....
:
:Why does the man command require the section number of the man page entry
:to be in the file name suffix, when it's already in the directory name?
:One possibility I considered is that it would allow you to link all the
:man<section> directories together if you wanted; however, I'm under the
:impression that the naming convention predates symbolic links (the only
:directory links that are normally permitted).

One reason is that people can have one man3 directory that contains


both system.3 (or 3c) and system.3f, just to name one scenario.

--tom


--
Tom Christiansen tch...@convex.com convex!tchrist

"What is the sound of Perl? Is it not the sound of a wall that
people have stopped banging their heads against?"
--Larry Wall in <1992Aug26.1...@netlabs.com>

REGI's

unread,
Oct 15, 1992, 12:36:50 PM10/15/92
to
>X-Envelope-to: info...@sem.brl.mil
>X-VMS-To: IN::" info...@sem.brl.mil"

1
13-OCT-1992 06:59:18.32
1 00:00:00.00
14-OCT-1992 06:59:18.32
info-uni...@sem.brl.mil
raf...@obelix.cica.es

Received: from SEM.BRL.MIL by ESEVVX.CICA.ES ; 10-OCT-1992 06:59:14.85
Received: from SEM.BRL.MIL by SEM.BRL.MIL id ac00943; 9 Oct 92 19:00 EDT
Received: from fncrd0.fnal.gov by SEM.BRL.MIL id aa28023; 9 Oct 92 15:47 EDT
Date: Fri, 9 Oct 1992 14:47:52 -0500 (CDT)
From: "Jorge Luis M. do Amaral" <AMA...@fnacp.fnal.gov>
Message-Id: <9210091447...@fnacp.fnal.gov>
Subject: What does cc -D option means ?
To: info...@sem.brl.mil
X-Vmsmail-To: SMTP%"info...@sem.brl.mil"

Hi ,
Does anyone can explain me what the cc -D option means ?

I'm trying to compile a program that has in his make something
like:
cc -g -DWANT_X11 -DWANT_MFB ....

The man does not help much . Is there anyone that can help me ?

Thanks,
Jorge (ama...@fnacp.fnal.gov)

REGI's

unread,
Oct 15, 1992, 1:22:21 PM10/15/92
to
>X-Envelope-to: info...@BRL.mil
>X-VMS-To: IN::"info...@BRL.MIL"

1
14-OCT-1992 07:04:38.10
1 00:00:00.00
15-OCT-1992 07:04:38.10
info-uni...@sem.brl.mil
raf...@obelix.cica.es

Received: from SEM.BRL.MIL by ESEVVX.CICA.ES ; 11-OCT-1992 07:04:34.84
Received: from SEM.BRL.MIL by SEM.BRL.MIL id aa06029; 10 Oct 92 22:10 EDT
Received: from wharf.brl.mil by SEM.BRL.MIL id aa06023; 10 Oct 92 22:04 EDT
Received: from AFTAC.AF.MIL by WHARF.BRL.MIL id aa25050; 10 Oct 92 21:53 EDT
Received: by aftac.af.mil (5.59/25-eef)
id AA04769; Sun, 11 Oct 92 01:43:53 GMT
Date: Sun, 11 Oct 92 01:43:53 GMT
From: John Krue <kr...@aftac.af.mil>
Message-Id: <921011014...@aftac.af.mil>
To: info...@BRL.MIL
Subject: UN-SUBSCRIBE ME PLEASE

UN-SUBSCRIBE ME PLEASE
UN-SUBSCRIBE ME PLEASE
UN-SUBSCRIBE ME PLEASE
UN-SUBSCRIBE ME PLEASE
UN-SUBSCRIBE ME PLEASE

Carl H. Miller

unread,
Oct 22, 1992, 1:32:20 PM10/22/92
to

I am having trouble in using lex. I've resorted to a small test file and still can not
seem to ever get any match into yytext[]. I've included the gist of the test program:

%% [X] /* this comment not in test file: look for cap. X */
while( yytext[0] != ')' )
{
switch( yytext[0])
{
case `\0`:
goto endloop;
case 'i':
fprintf( stdout, "found an i" );
case 'X':
fprintf( stdout, "found the X" );
default:
output( yytext[0] );
}
}
endloop:;

Eventhough my test file to be parsed contains X's, I never seem to see them in yytext.

this is how I compile:

prompt> lex lex.exp /* lex.exp is the above lex rule and code */
prompt> cc lex.yy.c -ll
prompt> a.out < lex.tst /* lex.tst is source to parse, contains X's */

all ideas and hints are appreciated, thanks.

Kenneth Edwards 268-6500

unread,
Oct 23, 1992, 9:37:04 PM10/23/92
to
In article <33...@adm.brl.mil> MIL...@gw1.hanscom.af.mil (Carl H. Miller ) writes:
>

Please put the odd newline in your file for those of us who have to
use 80 char screens and do not have a news reader that automatically does .

>I am having trouble in using lex. I've resorted to a small test file and
>still can not
>seem to ever get any match into yytext[]. I've included the gist of the
> test program:
>

I am hoping your real program bears no resemblance to your test program.

>%% [X] /* this comment not in test file: look for cap. X */

First, in lex, the action for a match must be a single statement.
The easiest way to do this is to get in the habit of enclosing in {}, so in
order for this program to work you must put these in -

[X] { /* this comment not in test file: look for cap. X */

while ....
endloop:;
}

[X] is a one char re that only matchs X. This means that yytext will
be X\0 when you enter your action for this case.

> while( yytext[0] != ')' )
> {

This test will always be true because your regex insures that yytext
only contains the letter capital X. Since you are not incrementing
yytext anywhere, which you cannot do, and do not have a counter in this
loop, that will put you into an infinite loop.

again, since yytext[0] is known to be X this switch can only go to the X
case.

> switch( yytext[0])
> {

You must have a forgiving compiler, mine will only accept '\0'.


> case `\0`:
> goto endloop;
> case 'i':
> fprintf( stdout, "found an i" );
> case 'X':
> fprintf( stdout, "found the X" );
> default:
> output( yytext[0] );
> }
> }
> endloop:;
>

So to re-write your program in somewhat simpler form:

%%
X { puts( "found the X" ); }

Of course the {} are not needed but they look good and you might want
to add a x++ or something and you already have your context established.

This will work. I believe that your problem is primarily an incorrect
regular expression. Lex DOES NOT match records in the sense that
awk does. Your one char RE in awk would return the entire line. In
lex it only returns one char. If you want to match any line that has
and X on it then:

%%
^.*X.*$ { printf( "found the X in :%s\n", yytext ); }

If you could give some more information on what you are trying to do,
perhaps we could be of more assistance.

--
_____________________________________________________________________________
Feeling amorous, she looked under the sheets and cried, OH NO it's micro soft


WOLCOTT, DAVID L.

unread,
Oct 29, 1992, 6:11:59 PM10/29/92
to
SUB DAVID WOLCOTT
0 new messages