HDTenEightyP/NetNews huggingface dataset:
From: tmiller@debug.cuc.ab.ca (Trever Miller)
Subject: Re: More fun with awk! (not associative arrays, I promise. ;-)
Organization: Debug Computer Services
Date: Wed, 26 Aug 92 00:50:39 GMT

>
>This isn't what I wanted! There can be ANY number of blocks of text
>and each block can be ANY size. Just so I can ramble further, let
>me make it VERY clear with another example:
>
>I have this file:
>
>...
>[2]      Canada         North America
>[3]      China          Asia
>[4]      Argentina      South America
>...
>[6]      United States  North America
>[7]      Scotland       Europe
>[8]      Australia      Australia
>[9]      Chad           Africa
>[10]     Brazil         South America
>...
>[13]     Mexico         North America
>[14]     Thailand       Asia
>[15]     Peru           South America
>
>
>I want to say:
>
>$ awk -f 1stblock testfile
>(and get the results)
>[2]      Canada         North America
>[3]      China          Asia
>[4]      Argentina      South America
>
>and
>
>$ awk -f lastblock testfile
>(and get the results)
>[13]     Mexico         North America
>[14]     Thailand       Asia
>[15]     Peru           South America
>
>I still can't figure out how to do this. And YES, I DO HAVE THE AWK BOOK!
>

OK, ok.  Maybe I didn't read your first post correctly. 
Here's a new script for you to try :

** Script started Tue Aug 25 18:44:50 MDT 1992.  File "typescript" **

$ cat block.awk
BEGIN  {FS="\n";RS="...";block+=0}
NF > 0 {record[i++]=$0}
END    {printf("block %d : %s\n",block,record[block])}

$ awk -f block.awk datafile
block 0 : 
[2]      Canada         North America
[3]      China          Asia
[4]      Argentina      South America

$ awk -f block.awk block=2 datafile
block 2 : 
[13]     Mexico         North America
[14]     Thailand       Asia
[15]     Peru           South America

$ awk -f block.awk block=1 datafile
block 1 : 
[6]      United States  North America
[7]      Scotland       Europe
[8]      Australia      Australia
[9]      Chad           Africa
[10]     Brazil         South America

$ exit

** Script ended Tue Aug 25 18:45:47 MDT 1992.  File "typescript" **

The block+=0 coerces it to a numeric value which then will default to
block=0 if none is given on the command line.

-- 
Internet : tmiller@debug.cuc.ab                 Magic BBS : "Ambush Bug"
           ambush.bug@debug.cuc.ab              (403)569-2882 thru 2886
           trever%pixel@cpsc.ucalgary.ca
From: tim@muppet.bt.co.uk (Tim Chandler)
Newsgroups: comp.unix.questions
Subject: Thesaurus Wanted
Date: 25 Aug 92 13:36:26 GMT
Reply-To: tim@muppet.bt.co.uk
Organization: British Telecom

I`m looking for a Thesaurus to use in an assignment.
Can any one help out ?

Thanks 
         Timbo.
Newsgroups: comp.unix.questions
From: aa@rexago8.uucp (Adam Andrews)
Subject: Re: logout message
Organization: Summit Information Systems
Date: Thu, 27 Aug 1992 12:52:57 GMT

hongman@cathedral.cerc.wvu.wvnet.edu (Guo Hongman) writes:
> Can anyone tell how to display some message when I logout?

In SysV, include in your .profile:

trap 'yourprog' 0

where yourprog is a program or script which prints out a message.

(the action of 'trap 0' is executed when the current process is exited)


-- 
-------------------------------------------------------------------------------
Adam Andrews                "When the going gets weird, we get even weirder."
uunet!rexago8!aa or aa@rexago8.UUCP
Newsgroups: comp.unix.questions
From: gialhu@giau01.gia.ch (Lukas Huesler)
Subject: WANTED: print spooling system
Reply-To: gialhu@giau01.gia.ch (Lukas Huesler)
Organization: Grapha Informatik AG
Date: Mon, 31 Aug 1992 12:12:36 GMT




Hello all

About one week ago I posted my first article (see below) to the world
I didn't get any answers. So I'm wondering if this article
was really distributed all over the world.

Please send a reply to the poster even if you don't have an answer to
the question below.

>We are a softwarehouse and develop an application for the logistics.
>This project is being developed with UniFace as 4GL on UNIX (Berkley
>and System V) platforms.
>Now we are looking for a product (available on BSD and System V) for
>print queue maintenance and print spooling.
>We think that the UNIX-tools (as included in the UNIX installation)
>are too complicated for our end-users.
>The Product we are looking for must meet the following goals:
>
>	- must be user-friendly
>	- The user must be able to start and stop queues
>	- The user must be able to requeue a spool-file
>	- The user must be able to manipulate the print queue entries
>	- (run's in GUI-environments ( X-windows))
>
>We would be very pleased if you could tell as whether you know a product
>which can do this.

thanks

-Lukas

-- 
Lukas Huesler  	      --------------Grapha Informatik AG---------------
gialhu@gia.ch	     / / ----------------------------------------------
--------------------/ / /  +41-64-814214 (home)    +41-62-997280 (work)
---------------------/-/   Peyermattstr. 3, 4665 Oftringen, Switzerland
Xref: sparky comp.unix.questions:10684 comp.unix.wizards:3776
From: sbarnhar@ncratl.AtlantaGA.NCR.COM (Scott Barnhart)
Newsgroups: comp.unix.questions,comp.unix.wizards
Subject: Extended chars in Unix
Date: 3 Sep 92 11:28:36 GMT
Organization: NCR Engineering and Manufacturing Atlanta -- Atlanta, GA



I am using Unix SystemVR4, and want to find a way to generate the
extended ASCII chars from the keyboard.  The reason for this is
to generate the appropriate foreign characters (such as the vowels 
with the accents, etc) needed in the various different languages 
(specifically French, German and other European languages).

I first thought it could be done somehow with the LOCALE stuff
in Unix, setlocale(), chrtbl(), etc.  But the man pages don't go
into how to generate or translate these characters.

If anyone has any idea how to do this sort of thing, please
e-mail me at sbarnhar@ncratl.AtlantaGA.NCR.COM, or post a reply.
I would really appreciate any help in this area.
From: ugo@oliver.sublink.org (Ugo Cei)
Newsgroups: comp.unix.questions
Subject: Re: Changing file names
Date: 29 Aug 92 09:49:05 GMT
Organization: Oliver System - Pavia ITALY

tchrist@convex.COM (Tom Christiansen) writes:

>As Mark Bush said, I sincerely hope that the future does not mean we
>must forever restrict ourselves to the tools that were available ten
>years ago.  

I sincerely hope that the future does not mean that we have to cope
with Unix systems that don't understand a "#! /usr/local/bin/perl" in
the first line of a script, so that we might run perl scripts without
typing "perl /usr/local/lib/perl/rename.pl ..." or using aliases or
stupid shell scripts to invoke them.

-- 
Ugo Cei --- Via Colombo 7 - 27100 Pavia - ITALY   |
         -- Sublink:  ugo@oliver.sublink.org      | "Real programs dump core"
From: udo@umunk.GUN.de (Udo Munk)
Newsgroups: comp.unix.questions
Subject: Re: reliable write()
Date: 24 Aug 92 03:30:18 GMT
Organization: umunk (private)
X-Newsreader: Tin 1.1 PL4

osycs@giac1.oscs.montana.edu (Craig Spannring) writes:
: In article <9208141294@umunk.GUN.de> udo@umunk.GUN.de (Udo Munk) writes:
: >
: >What about calling system("sync"); after a flush of the buffers for
: >systems which have neighter?
: 
: The Ultrix man page for sync(2) says the system call only schedules
: all pending disk output.  It may return before the writes actually 
: occur.  I assume that /bin/sync relies on sync(2) to perform the actual
: work.

Hm, my Coherent manual only says that sync writes the data from the kernels
buffers to disk. Nothing on when it returns. Maybe this works with some
systems and with others not, was only an idea...
--
Udo Munk     | voice:      +49 2131 275348             | uucp: +49 2131 278869
Oberstr. 21  | mail :      udo@umunk.GUN.de            |     2400/1200/300 8N1
4040 Neuss 1 | ...!{mcshh,smurf,unido}!easix!umunk!udo | MYNAME=bbsuser
Fed. Rep. of | CompuServe: 100021,2515                 | login: uucp
Germany      | at first connect get ~/info  and ~/files| pwd:   public
From: jjh00@outs.ccc.amdahl.com (Joel J. Hanes)
Newsgroups: comp.unix.questions
Subject: Re: FAQ
Date: 28 Aug 92 17:01:22 GMT
Reply-To: jjh00@OUTS.ccc.amdahl.com (Joel J. Hanes)
Organization: Amdahl Corporation, Sunnyvale CA


  zhu@cs.utexas.edu (Kai Zhu) writes:
>
>I would to like to have a copy of FAQ of this news group.
>Could anyone send me a copy or tell me the FTP site ?


Me too, please.  I've scanned the group every day for
nine weeks; where is the FAQ?

---
Joel Hanes              jjh00@outs.ccc.amdahl.com
From: dkowalsk@usdsd1.DaytonOH.NCR.COM (Dennis Kowalski)
Newsgroups: comp.unix.questions
Subject: Make with multiple directories
Date: 27 Aug 92 19:35:16 GMT
Reply-To: dkowalsk@usdsd1.DaytonOH.NCR.COM (Dennis Kowalski)
Distribution: world
Organization: NCR USG Data Services Division



 The following is an example of one of our make files.

TARGET = $(SYSMAKE)vlidump

LIB =$(LIBS)

OFILES= \
	vlidump.o


$(TARGET):  $(OFILES) $(LIB)
	$(CC) -o $@ $(OFILES) $(LIB)

vlidump.o: $(HFILES) 	$(INCDIR)/str2.h




  The LIBS variable is set prior to the make. This works fine.
  
  The INCDIR variable is set prior to the make. This works fine.

  The SYSMAKE variable is set to null or /some/dirname/ prior to the make
  running. 
  This results in the generated executable being written to the current
  directory or to some other directory.
  This works fine.


  My new problem is a requirement to have the source files in directory A,
  the make running in directory B, the .o files are to be written in 
  directory B, and 
  the executable writtten as before, either in the current directory (B)
  or the $(SYSMAKE) directory (C).

 Anyone have any ideas how to do this??

  
Dennis Kowalski         NCR Corporation  PCD-3                  (513) 445-1843
Systems Architecture    1700 S. Patterson Blvd              VOICEplus 622-1843
USG Data Services Div   Dayton, Ohio     45479
Dennis.Kowalski@DaytonOH.NCR.COM
-- 
Dennis Kowalski         NCR Corporation  PCD-3                  (513) 445-1843
Systems Architecture    1700 S. Patterson Blvd              VOICEplus 622-1843
USG Data Services Div   Dayton, Ohio     45479
Dennis.Kowalski@DaytonOH.NCR.COM
Newsgroups: comp.unix.questions
From: frank@D012S436.sniap.mchp.sni.de ()
Subject: Re: I want a program that prints out base gid's of any user
Organization: Siemens-Nixdorf AG
Date: Thu, 27 Aug 92 09:49:30 GMT

bzg52408@uxa.cso.uiuc.edu (Benjamin Z. Goldsteen) writes:
:    I have been trying to write a program that prints out the
: base gid of a user (given on the command line).  I have tried
: using awk and perl, but I can not get anything decent.
: Can show me how to do this.  One thing I have tried
: [ gid username ]
:  #!/usr/bin/awk -f
: BEGIN { FS=":"; FILENAME="/etc/passwd" }
: ARGV[1] == $1 {print $4}
: 
: I am not sure if 1 if right for ARGV, but whatever...anyway, it 
: won't read from /etc/passwd - it only reads from stdin.  I can;t
: make it do otherwise.
: 

How about:

#!/bin/sh
USER=$1
</etc/passwd awk '
 BEGIN { FS=":" }
 "'$USER'" == $1 {print $4}
'
--
Frank O'Dwyer		       			Disclaimer: 
Siemens-Nixdorf AG 	                        I will deny everything
Tel.  : +49 (89) 636-40639                      Fax.  : +49 (89) 636-45860
e-mail: Frank.ODwyer@sniap.mchp.sni.de
Newsgroups: comp.unix.questions
From: Bill Hansley <billh@mesaadm.cre.nt.com>
Subject: How to find IP addr of telnet session initiator??
Organization: NTI
X-Useragent: Nuntius v1.1b3
Date: Thu, 27 Aug 1992 13:20:17 GMT

If I telnet into a host and run a script/program that needs to know my IP
number, how can the program figure this out for itself (other than
prompting the user)?  The man pages for our telnetd (Interactive Unix
v3.0) mention something about Xdisplay origination, but mention nothing
about how to access this info. Am I missing something really obvious
here? A bit of C code, or a shell fragment, or just an idea of a place to
look?

Much thanks,
Bill Hansley
From: James_P._Stratton.OSBU_North@xerox.com
Newsgroups: comp.unix.questions
Subject: Attaching a Modem
Date: 31 Aug 92 19:28:11 GMT

Hi,

I am trying to attach a Telebit TrailBlazer Plus to a SPARC.  I can get it to
respond when dialed into or I can get it to dial out via tip.  But I can not
seem to get it to do both.  I could use some guidance.

Thanks,

Jim Stratton

---------------------------------------------------------------
Phone: (415) 813-7086
Xerox email: stratton:OSBU North:Xerox
Other email: stratton:osbu_north@xerox.com
3400 Hillview Ave
P.O. Box 10034
Palo Alto CA 94303-0816
---------------------------------------------------------------
you are in a twisty little passage of standards, all conflicting
---------------------------------------------------------------
Newsgroups: comp.unix.questions
From: ahusain@ad-22.Naitc.Com (Afsar Husain)
Subject: Re: Dear vi guru,
Organization: AC Nielsen Co., Bannockburn IL
Distribution: na
Date: Thu, 3 Sep 92 21:48:12 GMT

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?
>
>Most graciously,
> Brian
>
>p.s. please send all suggestions to switch to EMACS to /dev/null

What I have done is to map a free key such as a "w" or a "q"
with a macro. This macro will replace all the tabs with 4 spaces 
and then writes the file and quits the editor. You can include
such a mapped macro in the ".exrc" file

    map w :1,$s/     /    /g

The above map can be accomplished in a "vi" session by the following series of key
strokes. Ofcourse you have to substitute the "tab" character and the
"spaces" with the desired number of spaces.

    :map w :1,$s/tab/spaces/g^V^M:wq^V^M

The control M sequence can be generated by preceding it with
a control V i.e. ^V^M.


Hope this helps.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include    <standard.disclaimer>
email: ahusain@nis.naitc.com
From: jobrien@umescsnw1.umd.edu (JAMES M. O'BRIEN JR)
Newsgroups: comp.unix.questions
Subject: Need help compiling GCC on a Sun SS1+
Date: 28 Aug 92 13:05:09 GMT
Organization: University of Maryland Eastern Shore

The subject says it all.  It there is a different group I should
send this request too please let me, know. 

I believe I have all necessary src, but make doesn't seem to want to
take off.  In cc1 there exist Makefile.gnu which appears to be the
real makefile.  But install nots don't mention using make -f ....
just make which doesn't get any, I get an unexpected end of line.

Any help will be greatly appreciated.

Thanks


Jim O'Brien                     University of Maryland Eastern Shore
jobrien@umescsnw1.umd.edu       Network Manager
From: ssl20@RUTS.ccc.amdahl.com
Newsgroups: comp.unix.questions
Subject: terminfo capname
Date: 1 Sep 92 03:28:39 GMT
Reply-To: ssl20@RUTS.ccc.amdahl.com ()
Organization: Amdahl Corporation, Sunnyvale CA

What is the byte sequence for terminfo capnames 'cnorm', 'cvvis' and 'civis' for
'ibm-pc' and 'vt100'?

Thanks.

Steve Leung
Newsgroups: comp.unix.questions
Subject: man?
From: triemer@eagle.wesleyan.edu
Date: 28 Aug 92 23:21:50 EDT
Organization: Wesleyan University

Does "man" come standard with unix?  If not is there some place that I can 
snarf it from?  My little clunker 3b2 has diddly squat and I need man.


-Thomas Riemer
From: wsadkin@bbn.com (Will Sadkin)
Newsgroups: comp.unix.questions
Subject: spawning dbx on ones' self
Date: 2 Sep 1992 23:08:34 GMT
Distribution: world
NNTP-Posting-Host: daedalus.bbn.com


To Unix wizards who read this group,

I have an application where I need to have it start up a dbx on itself
a certain point in it's execution.  (For reasons I won't go into here, running
dbx on the process from the start just won't do...) The basic scheme I came 
up with is to:
    get the pid for the process
    fork
    in child:  
	run dbx on the pid of the parent
    in parent: 
	stop 

Unfortunately, I cannot get this to work...

If the parent sends itself a SIGSTOP, using kill, the dbx cannot
attach, and just blocks forever.

It seems that when dbx first attaches to a process it sends its own
SIGSTOP.  So I tried doing a sigpause(SIGSTOP), but this is not allowed.

I tried calling just pause in the parent; this results in the dbx 
wedging, not accepting keyboard input; the same result happens if
I simply call sleep. (What is happening here?)

Am I violating any fundamental rules?  If so, please let me know 
where I've gone wrong, and if not, does anyone out there have a 
solution to this problem?

/Will

-------------------------------------------------------------------------------
Will Sadkin                | "Never draw what you can copy;
BBN Systems & Technologies |  never copy what you can trace;
wsadkin@bbn.com            |  never trace what you can cut out and paste down!"
-------------------------------------------------------------------------------
From: duplain@rtf.bt.co.uk (Andy Duplain)
Newsgroups: comp.unix.questions
Subject: Re: Awk and getting the current date
Date: 3 Sep 92 13:57:08 GMT
Organization: BT Customer Systems, Brighton, UK

In article <1992Sep1.214207.1@sc9> mbrodesky@sc9 writes:
>How can I get the current date in a AWK program

	I assume you mean "awk" not "nawk" or "gawk"; nawk and gawk
	allow commands to forked and the output from those commands
	to be read (RTFM for details).  In awk you will have to wrap
	the awk script in a shell script and assign the date to an
	awk variable:
	
		#!/bin/sh
		awk -e 'BEGIN { 
			date="'`date`'"
		}
		{
			print date
		}'
		
		(or something like that)
	
-- 
Andy Duplain, BT Customer Systems, Brighton, UK.            duplain@rtf.bt.co.uk
#define	DISCLAIMER      My views and opinions are my own, and not my company's
Newsgroups: comp.unix.questions
From: mbrodesky@sc9
Subject: Awk and getting the current date
Organization: Intel Corporation, Santa Clara, CA USA
Date: Tue, 1 Sep 1992 21:42:07 GMT

How can I get the current date in a AWK program

Michael

Newsgroups: comp.unix.questions
From: CCMG <CCMG@MUSICA.MCGILL.CA>
Subject: NEW UNIX USER
Organization: McGill University
Date: Mon, 31 Aug 1992 16:03:51 GMT


Hi there,

  Im a beginner UNIX user, where should I subscribe to get
  help on UNIX commands, progamming for beginners etc..

  Giovanni

CCMG@MUSICA.MCGILL.CA
Newsgroups: comp.unix.questions
Subject: Re: csh variable distribution
From: ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig)
Date: Sat, 29 Aug 1992 00:29:31 GMT
Organization: University of Auckland, New Zealand.

ashish@tfs.com (Ashish Mukharji) writes:

>Is there a way to do "text substitution" in csh under BSD?

Are you sure you want csh? Anyway...

>dump $compression | dd

eval echo "dump $compression | dd"

should do what you want.
-- 
Thomas Koenig, ecmtwhk@ccu1.aukuni.ac.nz, ib09@rz.uni-karlsruhe.de
The joy of engineering is to find a straight line on a double logarithmic
diagram.
Xref: sparky comp.unix.questions:10645 comp.unix.bsd:5006
From: grog@adagio.UUCP (Greg Lehey)
Newsgroups: comp.unix.questions,comp.unix.bsd
Subject: Re: SUMMARY:  What Unix HW/SW I will buy with my $8000
Date: 2 Sep 92 10:02:06 GMT
Followup-To: comp.unix.questions
Distribution: comp
Organization: LEMIS, Schellnhausen 2, W-6324 Feldatal, Germany

In article <RG.92Aug29154123@nymph.msel.unh.edu> rg@msel.unh.edu (Roger Gonzalez) writes:
>
>I wanted to buy a Unix box for home, and posted asking what I should buy for
>$8000. 
>
>Looks like I will probably buy a
>- 50MHz 486DX2 EISA w/ SCSI, 8Mb, 340Mb, svga    ($3695)
                              ^^^ bad idea
>- replace their monitor with NEC 5fg             ($1000)
>- 1.2Gb disk                                     ($1200)
>- 2.3Gb tape                                     ($1200)
   ^^^^^^^^^^ can this read QIC-150 cassettes?
>- Dell Unix                                      ($1000)

8 MB should be considered an absolute minimum. You wouldn't get
anything like good performance out of the machine with that little
memory. Upgrading to 16 MB usually means throwing out the 8 MB of 1 MB
SIMMs and replacing them with 4 x 4 MB SIMMs.

Most software distributed on tape will come on QIC-24 or QIC-150. If
your nice 2.3 GB machine can't read them, it's only performing half
its duty.
-- 
Greg Lehey                       | Tel: +49-6637-1488              
LEMIS                            | Fax: +49-6637-1489
Schellnhausen 2, W-6324 Feldatal, Germany
*** NOTE ***: Headers get mangled at backbone - reply to grog%lemis@Germany.EU.net
From: cbb1@ra.msstate.edu (Chris B. Borchert)
Newsgroups: comp.unix.questions
Subject: Looking for program to make man page generation easier
Date: 26 Aug 92 18:32:01 GMT
Article-I.D.: ra.1992Aug26.183201.29167
Organization: Mississippi State University

Can anyone tell me a program which assists in man page generation instead 
of simply cutting text out of an old one and inserting new text in its
place?

Thanks,
Chris Borchert
cbb1@ra.msstate.edu
Xref: sparky comp.unix.questions:10383 comp.unix.programmer:4446
From: umnoor@ccu.umanitoba.ca (Nasir Ahmed Noor)
Newsgroups: comp.unix.questions,comp.unix.programmer
Subject: Pascal + UNIX = ?
Date: 26 Aug 92 05:18:12 GMT
Organization: University of Manitoba, Winnipeg, Canada


Hi,
I have a few questions about programming in Pascal in Unix env.
 
1). I want to execute a system command from within Pascal program (e.g. echo,
    awk etc). In C ``system()'' lets you do it, how to do it in Pascal?
 
2). I want to pass some program variables to awk, sed or some other Unix
    system command. In C ``sprintf()'' lets you do it, how to do in Pascal?
 
3). I want to use results produced by system commands (e.g. by echo, awk, sed)
    back in Pascal program. In C we use pipe, popen etc. How to do it in
    Pascal?
 
I would appreciate any help.
 
Thanks in advance!
 
--nasir
umnoor@ccu.umanitoba.ca
Xref: sparky comp.unix.questions:10455 comp.lang.c:12901