Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion (none)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
REGI's  
View profile  
 More options Oct 15 1992, 5:20 pm
Newsgroups: comp.unix.questions
From: NU...@esevvx.cica.es (REGI's)
Date: 15 Oct 92 16:02:27 GMT
Local: Thurs, Oct 15 1992 12:02 pm
Subject: (none)

>X-Envelope-to: INFO-U...@BRL.mil
>X-VMS-To: IN::"INFO-U...@BRL.MIL"

1
14-OCT-1992 02:22:38.15
   1 00:00:00.00
15-OCT-1992 02:22:38.15
info-unix-requ...@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-Unix-Requ...@BRL.MIL>
To:         INFO-U...@BRL.MIL
Reply-To:   INFO-U...@BRL.MIL
Subject:    INFO-UNIX Digest  V16#034
Message-ID:  <9210101516.aa04488@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 <kmccl...@ncrclm.clemsonsc.ncr.com>
Subject: Suggestions for good Unix5.4 tutorial.
Date: 6 Oct 92 16:35:26 GMT
To:       info-u...@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-u...@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 <n...@csc.liv.ac.uk>
Nntp-Posting-Host: hod.csc.liv.ac.uk
To:       info-u...@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 <y...@ll.mit.edu>
Subject: Re: Remote Printing from HP to BSD systems
Date: 7 Oct 92 17:52:17 GMT
Sender: n...@ll.mit.edu
To:       info-u...@sem.brl.mil

In article <1992Oct7.073653.20...@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-u...@sem.brl.mil

In article <1992Oct7.052622....@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 <csc5...@hertz.njit.edu>
Subject: A QUESTION
Date: 7 Oct 92 21:23:28 GMT
Sender: csc5...@hertz.njit.edu
Nntp-Posting-Host: hertz.njit.edu
To:       info-u...@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
csc5...@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-u...@sem.brl.mil

csc5...@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 <n...@athena.mit.edu>
Nntp-Posting-Host: zenobia.mit.edu
To:       info-u...@sem.brl.mil

On 7 Oct 92 21:23:28 GMT, csc5...@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 <rdor...@jade.tufts.edu>
Subject: Re: A QUESTION
Date: 9 Oct 92 23:09:12 GMT
Sender: USENET News System <n...@news.tufts.edu>
To:       info-u...@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    /   /__/  /--  / |/ |   /--
rdor...@jade.tufts.edu   |         /__    / \  /   /\    /__  /     |  /__
 --------------------------------------------------------------------------- ----

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

From: Alistair Banks <alist...@microsoft.com>
Subject: Re: NT Under SCO Unix
Date: 7 Oct 92 21:44:06 GMT
To:       info-u...@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-u...@sem.brl.mil

In article <1992Oct07.214406.28...@microsoft.com> alist...@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 <n...@informix.com>
Originator: billd@cheetah
To:       info-u...@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-u...@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 <dansm...@autodesk.com>
Subject: Re: IS UNIX DEAD?
Date: 8 Oct 92 00:48:24 GMT
To:       info-u...@sem.brl.mil

In <5...@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
            dansm...@autodesk.com            dansm...@well.sf.ca.us

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

From: Fred Rump from home <f...@compu.com>
Subject: Re: IS UNIX DEAD?
Date: 8 Oct 92 15:16:17 GMT
To:       info-u...@sem.brl.mil

dansm...@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:    f...@COMPU.COM     'mans feet have grown/so big
26 Warren St.   home: f...@icdi10.compu.com  that he/forgets his littleness'
Beverly, NJ. 08010                                      Don Marquis
609-386-6846    bang:uunet!cdin-1!icdi10!fr  

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

From: Gene Kochanowsky <g...@aee.aee.com>
Subject: Re: IS UNIX DEAD?
Date: 9 Oct 92 17:49:53 GMT
To:       info-u...@sem.brl.mil

f...@compu.com (Fred Rump from home) writes:

>dansm...@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.

        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
g...@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."
g...@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-u...@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 <patr...@casbs.stanford.edu>
Subject: Re: Need # of screen rows for shell variable
Date: 8 Oct 92 02:21:46 GMT
Sender: Patrick Goebel <patr...@casbs.stanford.edu>
Approved: news
To:       info-u...@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: patr...@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 <n...@ntuix.ntu.ac.sg>
Nntp-Posting-Host: v9001.ntu.ac.sg
To:       info-u...@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 <n...@u.washington.edu>
To:       info-u...@sem.brl.mil

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

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

From: unknown <hemst...@cs.colostate.edu>
Subject: Imakefile???
Date: 8 Oct 92 03:31:52 GMT
Sender: News Account <n...@yuma.acns.colostate.edu>
To:       info-u...@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: hemst...@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-u...@sem.brl.mil

dcul...@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 <haus...@aldetec.oz.au>
Subject: UNIX physical memory control
Date: 8 Oct 92 08:45:53 GMT
To:       info-u...@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:   haus...@aldetec.oz.au      --> GEMCO, Perth, Australia.

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

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

haus...@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:   haus...@aldetec.oz.au      --> GEMCO, Perth, Australia.

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

From: breho...@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-u...@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 : breho...@ul.ie

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

From: michael a migdol <mmig...@ccwf.cc.utexas.edu>
Subject: Anon FTP almost setup - ls problem
Date: 8 Oct 92 15:47:24 GMT
Sender: n...@ut-emx.uucp
Followup-To: comp.unix.questions
Originator: mmig...@grumpy.cc.utexas.edu
To:       info-u...@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-u...@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 <micha...@wshb.csms.com>
Subject: Fortran compiler or f2c translator
Date: 8 Oct 92 17:42:55 GMT
Followup-To: poster
To:       info-u...@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   #   letter...@csms.com
       Herald Broadcasting Syndicate, Inc.     #technical questions and reports
micha...@wshb.csms.com         +1 803 625 5552 #   letterbox-t...@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-u...@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-u...@sem.brl.mil

In article <1992Oct8.183108.21...@news.eng.convex.com> tchr...@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" <pfcou...@unix.amherst.edu>
Subject: Re: Man page naming convention
Date: 9 Oct 92 03:43:29 GMT
To:       info-u...@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

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

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

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

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

:In article <1992Oct8.183108.21...@news.eng.convex.com> tchr...@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:  b...@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 <osoelgaulti...@cmu.edu>
Subject: Login shell
Date: 8 Oct 92 18:36:59 GMT
To:       info-u...@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" <code...@cyclone.mitre.org>
Subject: Manipulating strings in batch file
Date: 8 Oct 92 19:25:31 GMT
Sender: News Service <n...@linus.mitre.org>
Nntp-Posting-Host: cyclone.mitre.org
To:       info-u...@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
dcode...@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 <n...@athena.mit.edu>
Nntp-Posting-Host: nefertiti.mit.edu
To:       info-u...@sem.brl.mil

On Thu, 8 Oct 1992 19:25:31 GMT, code...@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: n...@tivoli.uucp
Followup-To: comp.unix.dos-under-unix
To:       info-u...@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 <stss...@st.unocal.com>
Subject: Re: MIT X11R5 problem with SUID & SGID
Date: 8 Oct 92 21:37:46 GMT
Sender: Unocal USENET News <n...@unocal.com>
To:       info-u...@sem.brl.mil

In article <1992Oct6.200839.19...@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.My...@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: n...@cbfsb.cb.att.com
To:       info-u...@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-u...@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  <cole...@bldrdoc.gov>
Subject: Anyone can remove files
Date: 8 Oct 92 22:51:23 GMT
Sender: n...@dove.nist.gov
Originator: coleman@deputy
To:       info-u...@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
cole...@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-u...@sem.brl.mil

cole...@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_Richard_Steven...@MTS.CC.Wayne.Edu
     /.  /\ . __/.       T...@CMS.CC.Wayne.Edu
                         User...@WayneMTS.Bitnet

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

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

cole...@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, ecmt...@ccu1.aukuni.ac.nz, i...@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: n...@mdd.comm.mot.com
To:       info-u...@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 <n...@cbnewsh.cb.att.com>
Nntp-Posting-Host: wink.ho.att.com
To:       info-u...@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......@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-u...@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 <r...@undergrad.math.waterloo.edu>
To:       info-u...@sem.brl.mil

In article <Bvu2Cp....@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-u...@sem.brl.mil

In article <2...@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-u...@sem.brl.mil

In article <1992Oct4.055849.7...@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 <tmati...@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 <n...@athena.mit.edu>
Followup-To: comp.unix.questions
Approved: news-answers-requ...@MIT.Edu
Supersedes: <unix-faq/unix-intro_717397...@athena.mit.edu>
X-Last-Updated: 1992/09/24
Nntp-Posting-Host: pit-manager.mit.edu
To:       info-u...@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
tmati...@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 - tmati...@sunee.uwaterloo.ca
Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3

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

From: Ted Timar <tmati...@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 <n...@athena.mit.edu>
Followup-To: comp.unix.questions
Approved: news-answers-requ...@MIT.Edu
Supersedes: <unix-faq/contents_717397...@athena.mit.edu>
X-Last-Updated: 1992/09/24
Nntp-Posting-Host: pit-manager.mit.edu
To:       info-u...@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
tmati...@sunee.uwaterloo.ca.

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

From: Ted Timar <tmati...@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 <n...@athena.mit.edu>
Followup-To: comp.unix.questions
Approved: news-answers-requ...@MIT.Edu
Supersedes: <unix-faq/part1_717397...@athena.mit.edu>
X-Last-Updated: 1992/09/24
Nntp-Posting-Host: pit-manager.mit.edu
To:       info-u...@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
tmati...@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-Unix-Requ...@brl.mil or Unix-Wizards-Requ...@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 "mails...@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,
      e...@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 - tmati...@sunee.uwaterloo.ca
Empress Software, 3100 Steeles Ave E, Markham, Ont., Canada L3R 8T3

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

From: Ted Timar <tmati...@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 <n...@athena.mit.edu>
Followup-To: comp.unix.questions
Approved: news-answers-requ...@MIT.Edu
Supersedes: <unix-faq/part2_717397...@athena.mit.edu>
X-Last-Updated: 1992/09/24
Nntp-Posting-Host: pit-manager.mit.edu
To:       info-u...@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
tmati...@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
...

download full message


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.