HDTenEightyP/NetNews huggingface dataset:
From: snk@fork.bae.bellcore.com (Samuel Kamens)
Newsgroups: comp.unix.questions
Subject: Re: Awk: Beginner needs help!
Keywords: awk unix
Date: 4 Sep 92 20:22:38 GMT
Reply-To: snk@bae.bellcore.com
Distribution: comp.unix.questions
Organization: Bell Communications Research

In article <5608@ucsbcsl.ucsb.edu>, 6500scv1@ucsbuxa.ucsb.edu (Steven C. Velasco) writes:
> 
> HI,
> I am new to unix, and really new to awk, so hopefully somebody can
> answer this question real easily.  I have hundreds of SAS program
> files written for MVS, that we now need to run on UNIX.  
> The files from MVS look like this :
> 
> COMMAND? list unnumbered
> //MVS JCL statements
> //MVS JCL statements
> //MVS JCL statements
> DATA _NULL_ ;
>    SET SASLIB.DATASET ;
> MORE SAS STATEMENTS
> RUN ;
> 
> I can get awk to print out the lines that don't contain the string  "//"
> or "COMMAND?" in $1, but I would like to have
> something that replaces the entire line  "COMMAND? list unnumbered"
> (this is always the first line, and occurs just once) 
> with the string: "libname saslib /usr2/username/datasets"  or, to 
> somehow put the "libname" string in the first line of each file.
> So the resulting file would look like this:
> 
> libname saslib '/usr2/username/datasets' ;
> DATA _NULL_ ;
>    SET SASLIB.DATASET ;
> MORE SAS STATEMENTS ;
> RUN ;
> 
> below is my feeble attempt to do this.  When I run this program, I
> get a message saying something like 'awk: cant set $0 at record 1':
> 
> $1 !~ /\/\// { if ( $0 ~ /COMMAND? list unnumbered/ ) 
> $0 = "libname saslib /usr2/username/datasets ;" 
> print >FILENAME }  
> 
> What am I doing wrong?  I would appreciate any help or suggestions.

I think what you're doing wrong is using the wrong tool!

Try it with sed, as follows:

sed \
-e "s:COMMAND? list unnumbered:libname saslib'/usr2/username/datasets';:" \
-e /^COMMAND/d \
-e /^\/\//d \
filename > outfile.


You could also do it in awk, as follows:

awk '/^COMMAND?/ 	{ print "libname saslib '/usr2/username/datasets' ;"
			  next
			  }
     /^\/\//            { next }
			{ print }
' infile



See which one you like better!!

Sam Kamens					Bell Communications Research
snk@bae.bellcore.com				Phone: (908) 699-7509
444 Hoes Lane  Room RRC 1D-210
Piscataway, NJ 08854
From: c0408982@techst02.technion.ac.il (Michael Gleibman)
Newsgroups: comp.unix.questions
Subject: Modem access via telnet
Date: 2 Sep 92 09:30:20 GMT
Organization: Technion, Israel Inst. of Technology

Hello! 
  Can someone tell me, how can I dial to modem address using telnet
protocol and is it possible at all. Any help is appreciated.
Thanx in advance. 
                 Michael Gleibman,
Dept. of Mathematics, Technion, Israel,
e-mail:c0408982@techst02.technion.ac.il.
      
-- 
                        Michael Gleibman,
Dept. of Mathematics, Technion, Haifa, Israel,
e-mail: c0408982@techst02.technion.ac.il
Phone: (0972)(08)543820
From: idf@cs.bham.ac.uk (Ian Fitchet)
Newsgroups: comp.unix.questions
Subject: Re: How to determine user login time in minutes?
Date: 27 Aug 92 11:16:45 GMT
Organization: School of Computer Science, University of Birmingham

> On 26 Aug 92, Boris wrote

> I'd like to keep track of how long I've used the system.  This should be done
> in my .logout file.  I've played around with "last," but it won't give me the
> time for the _current_ session (it says "still logged in").  

> Is there a utility that I'm missing?  Or does someone know of a script 
> (preferably in Perl) that will figure out the login time?

 If you want to use last then why not background the job in your
.logout, sleep&loop until the "still logged in" is replaced with the
timestamp then do your numbering with that.

--
Cheers,

	Ian

-------------------------------------------------------------------------------
Ian Fitchet     				      I.D.Fitchet@cs.bham.ac.uk
School of Computer Science
Univ. of Birmingham, UK, B15 2TT
Newsgroups: comp.unix.questions,comp.lang.c
From: curt@watson.ibm.com (Curt McDowell)
Subject: Re: 'system' call uses 'sh'... Can I change this??
Date: Mon, 31 Aug 1992 22:18:03 GMT
Distribution: comp
Disclaimer: This posting represents the poster's views, not necessarily those of IBM
Organization: IBM T.J. Watson Research Center
Keywords: system sh

In article <1992Aug31.203936.20409@infonode.ingr.com>, henders@infonode.ingr.com (Greg Henderson) writes:
> Hopefully someone has run across a way to work around this...  
...
> Does anyone know a way to get the system call to use  a different shell
> 
> Greg Henderson   henders@infonode.ingr.com   ...uunet!ingr!infonode!henders

There's no way to do it directly.  /bin/sh is hardwired into the system()
routine.  Your best bet is just to live with /bin/sh, but if you must, you
can get around it indirectly (and inefficiently) like this:

main()
{
        system("exec /bin/ksh -c 'YOUR COMMAND HERE'");
}

Replace YOUR COMMAND HERE with whatever command you would have originally
wanted to run under ksh.  The "exec" causes /bin/sh to replace itself with
/bin/ksh right after it starts up.

For the C shell, use -fc instead of -c, so it doesn't read .cshrc (very
important).

--
Curt McDowell
IBM T. J. Watson Research Center
From: smp@cathedral.cerc.wvu.wvnet.edu (Shailesh M. Potnis)
Newsgroups: comp.unix.questions
Subject: Is there a way to know the system load and available resources
Date: 26 Aug 92 14:59:56 GMT


        I am trying to identify a command, if it exists to know the system load
in order to select a system on the network to run an application.  I know of
the commands like df or ps -aug to get some handle to the info.  What I am
really looking for is a command which gives me a good separate measures/
prediction of the throughput of running my next application on it for  memory
and/or cpu and/or io intensive jobs).though the parameters
change after starting the process.

        All comments and suggestions are highly appreciated.

        Shailesh


 
--
Shailesh Potnis, Associate	|Concurrent Engineering Research
Member of Technical Staff	|Center, West Virginia University
From: lauther@ztivax.UUCP (Dr Ulrich Lauther)
Newsgroups: comp.unix.questions
Subject: kermit, where to ask?
Date: 2 Sep 92 08:33:12 GMT
Reply-To: lauther@ztivax.siemens.com (Ulrich Lauther)
Organization: Siemens, ZFE BT SE 14

I have some problems with ckermit running under SCO XENIX/UNIX and Coherent,
running on 286 and 386 PCs, respectively.
What is the correct newsgroup (or maybe individual) to ask for help?

Thanks for help.

	-ulrich
[nosave]
----------------------------------------------------------------------------
Ulrich Lauther          ph: +49 89 636 48834 fx: ... 636 44950
Siemens ZFE BT SE 14    Internet: lauther@ztivax.zfe.siemens.de
                        from ems: lauther@ztivax:tcp-636-18:Mch P Siemens AG
From: jrd@cc.usu.edu
Newsgroups: comp.unix.questions
Subject: Re: kermit, where to ask?
Date: 2 Sep 92 11:59:49 MDT
Organization: Utah State University

In article <12956@ztivax.UUCP>, lauther@ztivax.UUCP (Dr Ulrich Lauther) writes:
> I have some problems with ckermit running under SCO XENIX/UNIX and Coherent,
> running on 286 and 386 PCs, respectively.
> What is the correct newsgroup (or maybe individual) to ask for help?
> 
> Thanks for help.
> 
> 	-ulrich
> [nosave]
> ----------------------------------------------------------------------------
> Ulrich Lauther          ph: +49 89 636 48834 fx: ... 636 44950
> Siemens ZFE BT SE 14    Internet: lauther@ztivax.zfe.siemens.de
>                         from ems: lauther@ztivax:tcp-636-18:Mch P Siemens AG
----------
	Straight C Kermit questions are best sent to Frank da Cruz,
fdc@watsun.cc.columbia.edu. Be sure to include all the version particulars.
More general Unix questions will find a wealth of knowledge in this News group.
	Allow time for holidays.
	Joe D. (who ought to take his own advice, but knows better)
From: mcramm@dct.ac.uk
Newsgroups: comp.unix.questions
Subject: Help needed reading Sun 8mm tape on rs6000
Date: 27 Aug 92 15:18:21 GMT
Organization: Dundee Institute of Technology


I'm trying to read an 8mm (Exabyte) tape written using tar on a Sun4
with (I think) the tape drive set to variable byte per block in hardware.
It was written to /dev/nsrmt0 using SunOs4.1.x tar.

The problem is that I'm trying to read it on our RS/6000 (Mdl 530) and can't
get anything to read bytes from the tape. I've tried using smit, chdev and tctl
to set the bytes per block to variable, but nothing produces anything from the
tape on read. Can anyone suggest any further action I could take. PLEASE!
(P.S. we 're running AIX 3.1)

Thanks in advance,

Angus

 Angus M. Marshall, 
 e-mail: MCRAMM@UK.AC.DCT.CC.VAXB           
         MCRAMM@UK.AC.DCT.CLUS                                 // 
         amarshal@uk.ac.dund.mcs                              //
 Phone: (+44 382) 308000 ext. 2265 or (+44 382) 308600    \\ //
                                                           \X/
".. and in the grove, by gate and hill, midst  merry  throng  and  market
clatter -  stood  the  Hall  of  the Mountain Grill, where table strain'd
'neath loaded platter "                             
(from the legend of Beenzon Toste - Hawkwind)
From: wade@nb.rockwell.com (Wade Guthrie)
Newsgroups: comp.unix.questions
Subject: Re: Dear vi guru,
Date: 3 Sep 1992 22:58:58 GMT
Distribution: na
Organization: Rockwell International


In article <1992Sep3.163059.10935@uhura1.uucp>, bryan@uhura1.uucp (Bryan Curnutt) writes:
> In article <1992Sep2.233330.18751@ncar.ucar.edu> tparker@music.scd.ucar.edu (Tom Parker) writes:
> >In article <1992Sep2.224136.24163@nsisrv.gsfc.nasa.gov> schieb@shark.gsfc.nasa.gov (Brian D. Schieber) writes:
> >>Dear vi guru,
> >> 
> >> I like to use tabs alot in just about every session of vi I
> >>work with, It would be great if I had a macro or whatever that
> >>could replace the tabs with the appropriate number of spaces
> >>in a file WHILE in vi. Do you have such a macro?
> >
> >Check if your system has the 'expand' command.  This command converts
> >tabs to spaces, and vice versa.
> 
> ... but is not what Brian asked for.

Well, not true. . .
The 'vi' user can use 'expand' from within 'vi'.  For example, to expand
tabs to 4 spaces throughout the file, one should do the following.
	1G
This will move the pointer to the beginning of the file.  Then,
	!Gexpand -4
Where the '!' says "I wanna do some external command", the 'G' says
"and I wanna do it from the current location (the top, 'cause of the
'1G') to the end ('cause 'G' says go to the end)" and the command
is "expand -4" which does the expansion (check out expand(1)).


> If your system does have the 'expand' command, then something like
> 
>     :map g :%!expand -4^M
> 

ya don't need 'map', but this DOES work. . .

Hope this helps.

Wade
Xref: sparky comp.unix.questions:10715 comp.editors:2144
From: martelli@cadlab.sublink.org (Alex Martelli)
Newsgroups: comp.unix.questions,comp.editors
Subject: Re: vi (cut and paste)
Keywords: vi
Date: 2 Sep 92 13:40:55 GMT
Organization: CAD.LAB S.p.A., Bologna, Italia

sgr@alden.UUCP (Stan Ryckman) writes:

:In article <1992Aug17.200149.7817@s912%bnf.com> bibb@s912%bnf.com (Ken Bibb) writes:
:>In <3815@keele.keele.ac.uk> phd85@seq1.keele.ac.uk (D.H. Holden) writes:
:>> hi, 
:>>    Does anyone know how you cut a range of text to one
:>>    of the named buffers, where the range does not cover
:>>   an integer number of lines, i.e., 
:>>  How do i cut from here > text  text text ..........
:>>  ............... n number of lines .....
:>> ...... to here <  into the named buffer "a for example?
:>>    Cheers,
:>>              Dave.
:>In the following texT:
:>aaabbbbbb
:>bbbbbbbbb
:>bbbbccccc
:>
:>I'll assume you want to cut the b's out and save them into buffer a.
:>1) position the cursor at the beginning of the range to be cut (1Gfb will work
:>   in this example).
:>2) ma (mark the location with marker a)
:>3) move to the end of the range (Gfc will work in this example)
:>4) "ad`a will cut the range and put it into buffer a
:
:NOT!
:
:This grabs all three full lines.  (I tried it!  Did you?)

You are wrong.  Yes, I did try Ken's suggestion, and it works perfectly!
Your mistake is probably that sub 4), where Ken specifies a ` (reverse
quote) you used a ' (quote); THAT would grab the three full lines!

:Dave presumably wants to have the remaining text be:
:aaaccccc
:
:and the buffer to contain:
:bbbbbb
:bbbbbbbbb
:bbbb

Which is EXACTLY what Ken's sequence does.

:"Mark" (the "m" command) only marks the line, NOT the cursor
:position within the line.

You are wrong.  m DOES mark the column position within the line; then,
if you use a ' (quote) to get back to the mark, you'll use the full
marked line, but if you use a ` (backquote) you'll get the exact
portion of the line.

:Am cross-posting to comp.editors, since someone there may know
:for sure whether there _is_ a way to do this, and if I'm wrong I'd
:like to know.  But please, _TRY_ it before posting!

The cross-posting was a good idea, since I'm reading this in
comp.editors.  And yes, I do know for sure, and YES, I *DID*
try the exact sequence of commands which you claim fail, and
they work like a charm.
-- 
Email: martelli@cadlab.sublink.org                   Phone: ++39 (51) 6130360
CAD.LAB s.p.a., v. Ronzani 7/29, Casalecchio, Italia   Fax: ++39 (51) 6130294 
Newsgroups: comp.unix.questions,comp.unix.bsd
From: ecoleman@qualcom.qualcomm.com (Eamonn)
Subject: Warning: 1 sector(s) in last cylinder unallocated
Reply-To: ecoleman@qualcom.qualcomm.com (Eamonn)
Organization: Qualcomm, Inc., San Diego, CA
Date: Thu, 27 Aug 1992 21:17:39 GMT

I'm trying to format a Fujitsu M2624FA under 386BSD. This is the disktab 
entry I'm using. 

# root partition: 64 Cyl (22.71 MB)
# swap partition: 103 Cyl (36.55 MB)
# user partition: 1296 Cyl (459.84 MB)
M2624SA|Fujitsu M2624SA|Fujitsu 520.1MB SCSI:\
	:dt=SCSI:ty=winchester:se#512:nt#63:ns#11:nc#1463:rm#4400:\
	:pa#44352:oa#0:ba#8192:fa#1024:ta=4.2BSD:\
	:pb#71379:ob#44352:tb=swap:\
	:pc#1013859:oc#0:\
	:pg#898128:og#115731:bg#8192:fg#1024:tg=4.2BSD:

Even if I try a different partitioning arrangement ( eg that provided
by diskpart -d ), I get the same error message from newfs:  "Warning: 
1 sector(s)in last cylinder unallocated". I don't know how severe this
error message is or what I can do about it. If anyone could help me out
here I would appreciate it. Email replies are fine. 

Many thanks!

btw the error shows itself only on partitions b or c while a and g are
fine. 
-- 
Eamonn Coleman                            Qualcomm Incorporated
eamonn@qualcomm.com                       10555 Sorrento Valley Road
Tel. (619) 597-5280                       San Diego, CA 92121-1617   
Newsgroups: comp.unix.questions
From: etxaha@eua.ericsson.se (Anders Hallberg)
Subject: make: bug?
Summary: Error in make when using : sh = macros
Keywords: make
Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden
Date: Wed, 26 Aug 1992 15:04:51 GMT

I wanted to create a make file that collected all files in a directory
tree with a given extension into a variable so I made the following
makefile as a test:

% cat Makefile
ALL_SRC :sh = find . -name '*.cc' -print
ALL_LIBS :sh = find . -name '*.a' -print

all:
        @echo '.cc files:'
        @echo $(ALL_SRC)
        @echo '.a files:'
        @echo $(ALL_LIBS)

I then created a directory tree with a number of .cc files but no .a
files and...

% make
.cc files:
./a/a/a/a.cc ./a/a/b/b.cc ./a/a/c/c.cc ./a/b/a/d.cc ./a/b/a/e.cc ./a/b/b/f.cc\
 /a/c/g.cc ./a/c/h.cc
.a files:
a/a/a.cc ./a/a/b/b.cc ./a/a/c/c.cc ./a/b/a/d.cc ./a/b/a/e.cc ./a/b/b/f.cc\
 ./a/c/g.cc ./a/c/h.cc

Not what I expected.  Then I created a .a file.

% touch a/a/a/a.a
% make
.cc files:
./a/a/a/a.cc ./a/a/b/b.cc ./a/a/c/c.cc ./a/b/a/d.cc ./a/b/a/e.cc ./a/b/b/f.cc\
 ./a/c/g.cc ./a/c/h.cc
.a files:
./a/a/a/a.a

Suddenly, it works.  Apparently the value of the macro is undefined if
there is no output from the shell command.  Changing the order of the
two macro definitions in the first case (no .a files) gave a different
value for ALL_LIBS.  I.e. when ALL_LIBS was defined first it became
empty.

As for versions and such, this is from the man pages of make:

Sun Release 4.1  Last change: 15 September 1989

Now, is this an error?  I think it is.

/Anders Hallberg
From: simonson@cs.washington.edu (Kevin Simonson)
Newsgroups: comp.unix.questions
Subject: Unix Script Debugger
Summary: Does one exist?
Keywords: unix script debug
Date: 4 Sep 92 20:16:04 GMT
Article-I.D.: beaver.1992Sep4.201604.717
Organization: Computer Science & Engineering, U. of Washington, Seattle


     I've been writing Unix scripts for a little bit now.  Whenever I have
trouble with one I always end up inserting a bunch of "echo" statements
into it to try to figure out what's wrong with it, and this has always
solved the problem for me eventually.

     My question is whether I'm wasting time with this farely brute force
method.  Does anyone know of a Unix script debugger to solve the problem
without editing the script?  Or even an automated editor that inserts
"echo" statements?  Any information on this would be helpful.

                                     ---Kevin Simonson
Newsgroups: comp.unix.questions,comp.unix.wizards,comp.unix.sysv386,comp.unix.admin,comp.unix.xenix.sco
From: raj@cse.iitb.ernet.in (Gokhale Rajendra V )
Subject: Problem with "umount" on SCO-ODT (UNIX v. 5.3.2)
Followup-To: poster
Organization: Department of Computer Science,IIT, Bombay
Date: Wed, 2 Sep 1992 20:27:16 GMT

We have an 80486 machine running SCO-ODT (UNIX v.5.3.2).  We have two
hard discs, one containing the root partition while the other (designated
as /dev/user) is mounted as /usr2.  The problem is that we are unable to
unmount the latter.  umount complains "/dev/user busy" although the
file system is not really busy.  This behaviour is observed with
unfailing regularity.
As a result, we can never  do a normal shutdown of the machine.
Can anyone help?

Thanks,
Rajendra Gokhale,
ADA project,
IIT Bombay.

To indicate the state of the machine here is some (possibly relevant) info.

---------------------------------------------------------------------------
An " fsck -n /dev/user " says 
"File system not modified"
I suppose this indicates that the file system  is corrupted but that it 
cannot be repaired because of the -n flag.
----------------------------------------------------------------------------

----------------------------------------------------------------------------
Any normal file related actions (creating, deleting, copying,
searching files/directories ) get done without any problems whatsoever.
----------------------------------------------------------------------------

----------------------------------------------------------------------------
The edited output of ps -el (only process names retained) on a typical
occasion was :
   bdflush biod cpd cron getty inetd init lckclnt lockd logger lpsched mountd
   nfsclnt nfsd portmap ps rexd routed rwhod sched sed sh slink statd strerr
   vhand
No user other than root was logged in.  Root was logged in the root
directory when this output was obtained.
----------------------------------------------------------------------------

----------------------------------------------------------------------------
This is the file /etc/default/filesys on our machine :

bdev=/dev/root cdev=/dev/rroot \
	mountdir=/ mount=no fstyp=AFS \
	fsck=no fsckflags= \
	desc="The root filesystem" \
	rcmount=no rcfsck=no mountflags= 
bdev=/dev/user cdev=/dev/rusr2 \
	mountdir=/usr2 mount=yes fstyp=S51K \
	fsck=no fsckflags= \
	desc="The usr2 filesystem" \
	rcmount=yes rcfsck=no mountflags= 
Newsgroups: comp.unix.questions
From: christo@bcarh803.BNR.CA (Mark Christopher)
Subject: Re: AWK and arrays
Reply-To: christo@bnr.ca
Organization: Bell-Northern Research Ltd.
Date: Fri, 4 Sep 1992 18:45:56 GMT

In article <1992Sep4.030733.27724@newshost.anu.edu.au>,
aps583@huxley.anu.edu.au (Anthony P Scott) writes:
|>Suppose I want to read a bunch of letters one to a line
|>and output the position in the alphabet that they occupy.
|>
|>ie
.. replace 'a' with '1', 'b' with '2', etc...

|>One way I visualized doing this is to write an array called alph[letter]
|>such as:
|>
|>alph[a] =1
|>alph[b] = 2
|>alph[c] = 3

You need to say:  alph["a"] = 1; alph["b"] = 2; alph["c"] = 3; etc...

|>and then read the lines of text as another array called charact[NR]

Why do you need to save them in an array?  Couldn't you just do:

	{ print alph[$1] }

|>and the use the charact array to subscript the alph array ie
...
the code didn't work because you didn't initialize your array "alph"
correctly.

What would be wrong with:
	{
		print index("abcdefghijklmnopqrstuvwxyz",substr($1,1,1))
	}

This would print 0 if the first letter of the first arg was not a
lowercase letter.



|>I hope this is not a silly question.

No such thing as a silly question.  Learn how to find the answers
yourself.  Read the man page, read the book, see the movie.  You
will find the answers faster.

-- 
Mark Christopher        Bell-Northern Research          christo@bnr.ca
Newsgroups: comp.unix.questions
From: christo@bcarh803.BNR.CA (Mark Christopher)
Subject: Re: awk with columns
Reply-To: christo@bnr.ca
Organization: Bell-Northern Research Ltd.
Date: Thu, 3 Sep 1992 22:24:16 GMT

In article <29098@hydra.Helsinki.FI>, karell@cs.Helsinki.FI (Esa Karell)
writes:
|>Could someone tell me what would be the easisest
|>way to accomplish this with awk.

|>X    Y  T        P I
|>1    2  3        4 5

|>I'd need to swap the values of Y & T so output should look:
|>
|>X    Y  T        P I
|>1    3  2        4 5
|>.    .  .        . .
|>
|>All the blanks between the columns should remain the same.

Well, what do you think?  Two easy ways:

Come up with a printf format string and say

	{ printf "....format....",$1,$3,$2,$4,$5 }

or else find the column numbers and do:

	{ print substr(..),substr(..),... }

-- 
Mark Christopher        Bell-Northern Research          christo@bnr.ca
Newsgroups: comp.unix.questions
From: obi@gumby.ocs.com (Kuryan "Obi" Thomas)
Subject: Re: Help: RCS from Purdue U?
Reply-To: obi@gumby.ocs.com
Organization: Online Computer Systems, Inc.
Date: Tue, 1 Sep 1992 21:49:04 GMT

In article <92244.161444JORDAN@auvm.american.edu>,
<JORDAN@auvm.american.edu> writes:
> Can anyone tell me about a configuration management program for UNIX called RCS
> (Revision Control System).  I've heard that it is a shareware product that
> recently got an upgrade to V5.7.  Please respond.

[ I responded to this by email enclosing a fact sheet I got with RCS; hope
  you received it. ]

Can anyone confirm that 5.7 is out? Uunet lists only 5.6. Thanks.
From: hienl@Saigon.COM (Hien Luu)
Newsgroups: comp.unix.questions
Subject: Socket and File Descriptor
Date: 22 Aug 92 20:00:16 GMT
Distribution: usa
Organization: Station Zebra Corp, Sunnyvale CA Ph:408-739-1520

I was reading about sockets and learned that sockets are referenced by
file descriptors.  I assume this is the same file descriptors that comes
from the file descriptor table.  I also learned that each UNIX process
has 20 files descriptor at its disposals.  What happens if the a process
reaches the maximum number of allowed file descriptor?  Does the process
get killed by the operating system?

I would appreciate some more explanation the relationship between
the file descriptor and sockets.  Where does the number 20 come from and
is this a configurable number?

thanks in advance.