HDTenEightyP/NetNews huggingface dataset:
From: rem@public.btr.com (Robert E. Maas  rem@btr.com)
Subject: Novice programming question: How to read from pipes?
Organization: The Ohio State University Department of Computer and Information Science
Date: Wed, 30 Dec 1992 05:07:17 GMT

I'm just starting programming on Unix, trying various things, having
trouble reading from pipes. The following program seems to create a
pipe and write data to one end, but I'm not sure because it bombs out
with "Segmentation fault" when it tries to read that data from the
other end of the the pipe. Anybody want to give me a clue what's wrong
(Please e-mail to rem@BTR.Com)?

Here's the complete test-program, and what happens when I run it (this
is on SunOS 4.1.1, if that makes any difference):

#include <stdio.h>
main()
  {printf("Test rig...\n");
   tryPipe();
   printf("\nAll Done.\n");
   }

tryPipe()
  {int fd[2],res,ch;
   printf("Making a pipe ...\n");
   res = pipe(fd);
   printf("res=%d fd = %o %o\n",res,fd[0],fd[1]);
   printf("Writing some bytes ...\n");
   fputc('Q',&fd[1]); /* Just one byte until I get it working */
   printf("Reading the data back in ...\n");
   ch=fgetc(&fd[0]);
   printf("<<%c>>\n",ch);
   }


Test rig...
Making a pipe ...
res=0 fd = 3 4
Writing some bytes ...
Reading the data back in ...
Segmentation fault (core dumped)
Newsgroups: comp.unix.questions
From: lstein@Ingres.COM (Larry Stein, Ingres Consulting - Dallas)
Subject: Looking for article on keeping UNIX boxes clocks in synch
News-Software: VAX/VMS VNEWS 1.4-b1  
Keywords: 
Organization: ASK Computer Systems, Ingres Product Division
Distribution: na
Date: 24 Dec 92 03:26:39 GMT

There was an article within the last year in the Sys Admin Journal
(or some related publication).  It had a program used to keep networked UNIX
boxes in synch by designating "correct" nodes and regularly adjusting to
the correct box's time. Can anyone point me to the correct
magazine and issue?

Plz email to lstein@ingres.com.

Thanks,

Larry Stein
Newsgroups: comp.unix.questions
From: mike@highlite.uucp (Mike Wiik)
Subject: scandir() for SCO Unix Sys V 3.2
Keywords: porting problems
Organization: Gotham Communications Research
Distribution: comp
Date: Wed, 23 Dec 1992 01:00:15 GMT

Apologies if I should know this. I'm looking for a System V
version of the handy BSD scandir() function to complete a
part-time porting job. If all else fails I'll write it myself,
but why try to recreate another's brilliant solution? :)

Thanks - and please e-mail, I don't get to read this group
as often as I should.

	-Mike	mike@highlite.gotham.com

-- 
   | o==== . : ... :  :  .     |Mail Me Neat Stuff->POB 3703 Arlington VA 22203
 --@-- . o o o ... O -O- o o : |No disclaimers needed: I actually pay for this.
   |           ... :  :        |-----------------------------------------------
mEssAGE fRoM sPAcE ARt stUdiOs |Man:TheMissingLinkBetweenApes&HigherIntelligence
Newsgroups: comp.unix.questions
From: dman@netcom.com (Dallman Ross)
Subject: Re: Question about .forward
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
X-Newsreader: TIN [version 1.1 PL8]
Date: Wed, 23 Dec 1992 07:09:27 GMT

Rob Quinn (rjq@phys.ksu.edu) wrote:
: In <1992Dec21.232605.10593@netcom.com> dman@netcom.com (Dallman Ross) writes:
: > If I have a .forward file directing a cc of mail to another system, can
: > I safely rm mbox [N.B.  I meant "my spool mail, not "mbox"] without fear 
: > of losing mail that comes right at that moment?  Or does the .forward work 
: > only *after* mail is deposited in the spool, which could result in such 
: > a loss?

:  Yes, you can. A simple way to check would be to look at the access times on
: the mailbox once you have installed your .forward.
:  But why would you want to remove your mailbox? Why not just leave it there,
: with zero length? On most systems the mail directory is world writable, so
: someone else could create a mailbox for you with world readable/writable
: perms. If you ever rm your .forward, you will start using this ``fake''
: mailbox.

Good idea on the access times; and very illuminating on the fake
spoolfile info!

The reason I want to rm the file is that I want to have a background
script deal with this on a system where I am charged for access time.
I don't want the clock ticking while I type "mail," "d*," "q" -- but
I haven't figured out how to do that in a shell script.  Otoh, I
*have* figured out how to "rm /usr/spool/mail/$USER" in a shell
script.

--
 __D_a l_l m a_n  _ R o_s s _ |dman@netcom.com  /or/  |"You sound like a man|
 l  \\ l\\   /l  /\\  l\\   l |dross@well.sf.ca.us    |with a rubber nose." |
 l   >)l \\ /ll /  \\ l \\  l |vox/fax: 1.510.645.1883| -- One-Lung Bill    |
 l  // l  \X ll/--- \\l  \\ l |350 Perkins St., #108  |     Remmer (deceased)
_l//______________________\\l_|Oakland,_CA__94610-3422|_____________________|_
Newsgroups: comp.unix.questions
From: subbarao@fc.hp.com (Kartik Subbarao)
Subject: Re: How do I find other machine names at a domain site?
Originator: news@nimaster
Reply-To: subbarao@fc.hp.com
Organization: putchar('I'); for (i = 0; i < 3; i++) putchar('E');
Date: Thu, 24 Dec 1992 15:08:38 GMT

In article <1992Dec24.065553.24954@mnemosyne.cs.du.edu> mrosen@nyx.cs.du.edu (Michael Rosen) writes:
>I have a domain site, etown.edu, and know of one machine name on that
>domain, vax.etown.edu.  What I'm wondering is, is there a way to find
>other machine names at etown that I can finger to look for a user?

Use nslookup. Set the domain server to be vax.etown.edu, and ls -d
etown.edu. Like this:

> server vax.etown.edu
Default Server:  vax.etown.edu
Address:  192.146.186.2

> ls -d etown.edu
[vax.etown.edu]
Host or domain name            Resource record info          
 etown.edu                      SOA   VAX.ETOWN.EDU POSTMASTER.VAX.ETOWN.EDU. (920820 7200 7200 12096000 604800)
 etown                          NS    server = VAX.ETOWN.EDU                 
 etown                          NS    server = CHARON.PSC.EDU                
 BLUEJAY                        A     192.146.186.10
 BLUEJAY                        HINFO PC         UNIX-SYSTEM-V
 ALBERT                         A     192.146.186.30
 ALBERT                         HINFO SUN        SUNOS
 ISAAC                          A     192.146.186.20
 ISAAC                          HINFO PC         DOS-SYSTEM
 NIELS                          A     192.146.186.40
 NIELS                          HINFO PC         UNIX-SYSTEM-V
 VAX                            A     192.146.186.2
 VAX                            HINFO MicroVAX-3100 VMS
 etown.edu                      SOA   VAX.ETOWN.EDU POSTMASTER.VAX.ETOWN.EDU. (920820 7200 7200 12096000 604800)



	-Kartik
From: cp486a!kvancamp@cpmail.att.com
Newsgroups: comp.unix.questions
Subject: >To: cpmail!brl.army.mil!info-unix
Date: 30 Dec 92 18:16:36 GMT

Original-From: kvancamp
Date: Wed Dec 30 13:13:21 EST 1992
UA-Content-ID: <PMX-LAN-2.2.1-******-cp486a-kvancamp-693>
End-of-Header:
Email-Version: 2
Phone: (201)581-4513
Subject: Application expects Enter key
UA-Message-ID: <winPMXSTAR-2.2 Rel 1.0 -kvancamp-XYXYXYXYXY-79>
To: cpmail!brl.army.mil!info-unix@cpmail.att.com
End-of-Protocol:
Content-Type: text  
Content-Length: 1121   

I have a Unix Sys V/386 (Rel 4) application that always ends by asking the 
user to "Press Enter To Continue".  I need to run the application in an 
unattended mode, so this prompt is undesirable.  Since the process is 
otherwise non-interactive, I tried the obvious solution of:

echo | command

This gave an error message from the shell:

Write to pipe with no Reader

Is there another way to fool the application into thinking I'm hitting the 
Enter key?

In case it matters, the application in question is Simul-Task (version 3.01), 
which allows me to run a DOS application on my Unix system.  Simul-Task 
provides a -n option that is supposed to stop this prompt, but it is not 
implemented in this release, and I called NCR who confirmed this and said they 
have no plans for future Simul-Task releases on my platform.

Please respond directly to me, I will summarize results if anyone is 
interested.

Ken Van Camp    <cp486a!kvancamp@cpmail.att.com>
                AT&T Consumer Products Division
                5 Wood Hollow Road  Room 1H36
                Parsippany, NJ  07054
                (201)581-4513
Newsgroups: comp.unix.questions,comp.terminals,comp.sys.tandy
From: lachman@netcom.com (Hans Lachman)
Subject: Need termcap for DEC VT05
Keywords: Unix termcap DEC VT05 TRS-80
Organization: Netcom
Distribution: na
Date: Sat, 2 Jan 1993 02:30:00 GMT

Can anyone send me the correct Unix termcap entry for a DEC VT05 terminal,
or let me know where I can find it?

(The equipment I have is actually an old TRS-80 model 1, with a communication
program called Comm-80 that apparently emulates a DEC VT05.)

Thanks,

Hans Lachman
lachman@netcom.com
Newsgroups: comp.unix.questions
From: heiser@ferrari.nmc.ed.ray.com (Bill Heiser)
Subject: inaccurate 'du'
Organization: Equipment Division, Raytheon Company
Distribution: usa
Date: Wed, 23 Dec 92 15:01:28 GMT

I think I need a vacation.  This question should be tooo simple!

Anyway...  Regarding 'du'.  When I do a 'du' of an entire directory
structure, it reports one number, say 503438 (so it's roughly 500 mb).

However if I do a du on selected entries in that directory structure,
like du -s */*/abc */*/ddd, each total comes to a numbers that total
much higher than the du of the entire directory.  

I've done the du -s such that directories aren't (as far as I can see)
reported twice.  Am I overlooking something obvious here?  I need
to get usage info for certain subdirectory structures, and this should
be an extremely simple task! :-(


-- 
* Happiness is a hot boiled lobster with drawn butter, a side dish of hot    *
* fresh steamers w/melted butter & a hot corn on the cob with butter & salt  *
Work: heiser@TDWR.ED.RAY.COM
Home: bill@unixland.natick.ma.us
From: adrian@romulus.rutgers.edu (Adrian Rodriguez)
Newsgroups: comp.unix.questions
Subject: Re: Usage of man ..
Date: 28 Dec 92 06:05:48 GMT
Organization: Rutgers Univ., New Brunswick, N.J.
Cc: adrian

vprasad@cs.ulowell.edu (V G Prasad) writes:
> I want to know how to read a man page using the man command
> when the man page is not in the standard directory.
> The man page about man says to use -P option

Hmmm.  My manpage for man says use -M to indicate a man-type directory subtree
other than the default one(s).  It doesn't say anything about a -P option.  If
the file you're trying to format is not in a man-style directory subtree, try
`nroff -man filename | more'.


Regards,

adrian
Newsgroups: comp.unix.questions
From: jpr@jpradley.jpr.com (Jean-Pierre Radley)
Subject: Re: word cracker
Date: Fri, 01 Jan 1993 18:43:50 GMT
Organization: Unix in NYC

In article <1992Dec30.235126.25601@mnemosyne.cs.du.edu> sscrivan@nyx.cs.du.edu (steve scrivano) writes:
>OK, gurus!  Can anyone solve this problem?
>
>I am looking for a fairly portable "C" program or script that will produce
>every possible 4 letter or greater combination using the following
>letters:
>
>c e e f g h i i l l n n o p p r r r s s t t t u
>
>
>Some of the letters appear more than once and therefore will increase the
>possible number of combinations possible.  I realize that the number of 
>combinations are incredible and will probably consume a great deal of
>cpu time.  My intentions are to find every possible word that 4 or more
>of these letters can create.  Each time a letter combination is created,
>that combination would be compared with /usr/dict/words and if found
>there it would be concatenated to a resulting word file.
>
>The end result would be a word file created with all possible combinations.
>You might say, sort of a crossword puzzle cracker.  It would be ideal if
>the program could accept input so all I had to do is enter in the letters
>and it would the job from there although not mandatory.
>

Here's a script wich filters what you don't want out of /usr/dict/words.

	</usr/dict/words tr '[A-Z]' '[a-z]' |
	sed '
	/^.$/d
	/^..$/d
	/^...$/d
	/[abdjkmqv-z0-9]/d
	/c.*c/d
	/e.*.e.*e/d
	/f.*f/d
	/g.*g/d
	/h.*h/d
	/i.*.i.*i/d
	/l.*.l.*l/d
	/n.*.n.*n/d
	/o.*o/d
	/p.*.p.*p/d
	/r.*r.*r.*r/d
	/s.*.s.*s/d
	/t.*t.*t.*t/d
	/u.*u/d
	' > out.file

Note that /usr/dict words doesn't contain 'called', 'calling', 'calls' ;
spelling programs know a bit of English, and can construct those once they've
found 'call' in the file.

I made my own assumption about capitalized words, converting them and keeping
them.
-- 
Jean-Pierre Radley   Unix in NYC   jpr@jpr.com   jpradley!jpr   CIS: 72160.1341
Newsgroups: comp.unix.questions
From: ktf@bc3.GUN.de (Klaus ter Fehn)
Subject: Re: how to change shell's PWD(directory) from a C program?
Organization: private
Date: Wed, 30 Dec 1992 06:02:31 GMT

In article <1hqe2cINN6ot@usenet.INS.CWRU.Edu> cl820@cleveland.Freenet.Edu (Wei Jin Mai) writes:


>	Here is what I want to do: UPon the termination of my program, I 
>want to change to another directory . Normally, a program exit to the
>directory that invoke it. 

Because of the current newsgroup (comp.unix.questions) I assume, that
you're programming under the UNIX-environment. Note, that the PWD (Path
of Working Directory) is an environment-held information of a process.
Each process gets a copy of the environment of it's parent-process at
startup-time. So if you call the cd() funktion from within a C-Program,
only the PWD of the C-program-process is changed. When you exit this
program, you are returning to the parent-process (most cases: the
shell). It's PWD information was not changed, because you only changed
the child's copy.

There is a workaround with the alias/functions in some shells. Let's assume
a very simple sample: The C-Program writes it's PWD into a file $HOME/.pwd
let's name the C-Program myprogram.

Bourne-Shell: Define a Function 'mycall' (maybe in your .profile) 
	      which looks like this:

mycall() {
	myprogram
	cd `cat $HOME/.pwd`
}

Korn-Shell: Define an alias to call your program:

alias mycall='myprogram; cd `cat ~/.pwd`'

In both cases you got to invoke your program with the command 'mycall'.
I'm not familiar with the C-Shell, but I know there is a way to do so,
too.

Note, that THIS is just one way to do what you need. There are some other,
more efficient ways, but that depends on your program and the Shell you use.

-- 
Klaus ter Fehn		<ktf@bc3.GUN.de>
Neanderstr. 4		{mcshh,smurf,unido}!easix!bc3!ktf
4000 Duesseldorf 1
FRG / Germany		Tel.: +49-211-676331
Newsgroups: comp.unix.questions,comp.unix.sys5.r4,comp.unix.i386,comp.unix.admin,comp.unix.pc-clone.32bit
From: rvenable@helix.nih.gov (Richard M. Venable)
Subject: Re: Problem with lp.  Got me stumped.  (email, I'll sum)
Organization: National Institutes of Health, Bethesda
Date: Fri, 1 Jan 1993 01:46:37 GMT

In article <1hu0hfINNicm@spool.mu.edu> marcr@studsys.mscs.mu.edu (Marc Rassbach) writes:
>This one has me stumped.  But perhaps I'm missing something simple....
>
>Hardware:
>ALR VESIA business system  (486 25mhz EISA box)
>HP laserjet+  (and a IId too)
>
>Software 
>Esix SysV rev 4.0.3 with bugfix for lp1 lp2 slowness
>
>Problem:
>I have a file that has imbedded softfonts to be DLed to the printer.
>
>What happens when it doesn't work is the softfonts get
>'munged' aka the 1 refuses to print in one of the fonts, the y
>and other characters in another, ad nausium.

I've run across a similar problem using TeX on Apollo workstations, using the
dvihp program supplied by the vendor (ArborText).  The letter 'i' is omitted,
only the lowercase, but bold or italic 'i' gets printed.  I've also had trouble
printing bitmaps in general on Series II LaserJets, even those with about 2 Mb
of RAM.  I can reproduce this bad behavior on several different Series II
machines, especially the missing 'i' from a downloaded font.  I can show the
problem to be independent of the print server by using "cat"; other than that,
I'm stumped, too.  Could it be some sort of tragic flaw in PCL, or perhaps the
ROMs in HP Series II LaserJets?


-----------------------------------------------------------------
 Rick Venable                  |    "Eschew
 FDA/CBER Biophysics Lab       |   Obfuscation"  
 rvenable@helix.nih.gov        |         -- the Phantom Nerd   
-----------------------------------------------------------------

Newsgroups: comp.unix.questions
From: rem@public.btr.com (Robert E. Maas  rem@btr.com)
Subject: Novice programming question: How to pass stdin to tcgetattr?
Organization: The Ohio State University Department of Computer and Information Science
Date: Tue, 29 Dec 1992 19:04:29 GMT

I'm just starting to program on Unix, and having trouble (please e-mail
any answers to rem@BTR.Com):

How do I convert stdin (a pointer to a word containing the number zero)
to a valid integer fd (file descriptor I presume) for passing to
tcgetattr and related functions? I tried passing stdin and stdin* but
each produced runtime errors (errno=9 and 14 respectively).
#define EBADF           9               /* Bad file number */
#define EFAULT          14              /* Bad address */

Where do I find stdio.h? (It's not on /sys/sys with termio.h etc.)
More general question, given that cc can find some header file such as
stdio.h just fine, how do I find out where it's finding it from?
(What's the equivalent of 'whereis' for C header files?)

In case it makes any difference, this is SunOS 4.1.1

Here's my complete source code in case it helps diagnose what I'm trying.

#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include <errno.h>
main()
  {printf("Hello on Unix stdin=[%d]->[%d]\n",stdin,*stdin); /* *stdin is 0 */
   tryTermios();
   printf("All Done.\n");
  }

tryTermios()
  {int fd,res;
   struct termios *termios_p,ti;
   termios_p=&ti; /* Want to use malloc here, that's a different question. */
   printf("Going to call it ...\n");
   res = tcgetattr(stdin, termios_p); /* res=-1 errno=9 How to fix it? */
   printf("Called it, res=%d",res);
   if (res<0) {printf(" errno=%d\n",errno); return; }
   printf(" going to get fields ...\n");
   printf(" c_iflag=%o c_oflag=%o\n c_cflag=%o c_lflag=%o c_line=%o\n",
          (*termios_p).c_iflag,(*termios_p).c_oflag,(*termios_p).c_cflag,
          (*termios_p).c_lflag,(*termios_p).c_line);
   }
Xref: sparky comp.unix.questions:14908 comp.lang.perl:7587
From: merlyn@ora.com (Randal L. Schwartz)
Newsgroups: comp.unix.questions,comp.lang.perl
Subject: Re: maybe another stupid question: cookie server
Date: 23 Dec 92 07:07:58 GMT
Article-I.D.: romulus.MERLYN.92Dec22230755
Followup-To: comp.unix.questions
Organization: Stonehenge Consulting Services; Portland, Oregon, USA

In article <1992Dec18.200019.4175@tolten.puc.cl> daniel@isluga.puc.cl (Daniel Hirschberg) writes:
	   Does anybody know where i can get a cookie server daemon for
   sun?
	   If there's anyone who can iluminate me in this topic i would
   really apreciate it!


Here's one that I wrote in Perl for a class that I taught:
[WATCH THE FOLLOWUPS: REMOVE COMP.LANG.PERL IF NO MORE PERL.]

#!/usr/bin/perl
require 'sys/socket.ph';
$sockaddr = 'S n a4 x8';
chop($hostname = `hostname`);
($name, $aliases, $proto) = getprotobyname('tcp');
$port = 4242; # some big number
$thisport = pack($sockaddr, &AF_INET, $port, "\0\0\0\0"); # wildcard addr

socket(S, &PF_INET, &SOCK_STREAM, $proto) || die "cannot create socket: $!";
bind(S,$thisport) || die "cannot bind socket: $!";
listen(S,5) || die "cannot listen socket: $!";
for (;;) {
  accept(NS,S) || die "cannot accept socket: $!";
  print NS &fortune;
  close NS;
}

sub fortune {
  @fortunes = split(/\n%%\n/, <<'END') unless @fortunes;
A fool and his money are soon parted.
%%
A penny saved is a penny earned.
%%
Ask not what your country can do for you;
ask what you can do for your country.
%%
END
  splice(@fortunes,int(rand(@fortunes)),1)."\n";
}

Just another Perl hacker,
--
Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
merlyn@ora.com (semi-permanent) merlyn@reed.edu (for newsreading only)
factoid: "Portland, Oregon, home of the California Raisins and Lone-Star Beer!"
Xref: sparky comp.unix.questions:14887 comp.unix.misc:4673 comp.unix.ultrix:9042
From: sjs@sbphy.physics.ucsb.edu (Steve J. Schmidhauser)
Newsgroups: comp.unix.questions,comp.unix.misc,comp.unix.ultrix
Subject: Suggestions for Unix textbook
Summary: Need suggestions for beginning Unix course
Date: 22 Dec 92 19:06:08 GMT
Followup-To: comp.unix.questions

SBCC's Com Sci dept. is going to be offering a new course on Unix. The 
instructor has ask me for suggestion as to texbooks and course content.
Please share your experience with us, TIA
--
Steve Schmidhauser               |  INTERNET: sjs@sbphy.physics.ucsb.edu
LTA Santa Barbara City College   |  Backup: 2209schm@ucsbuxa.ucsb.edu
721 Cliff Dr, S.B.,CA 93109      |  PHONE: (805)965-0581 x2401
Newsgroups: comp.unix.questions
From: donovan@calvin.ee.udel.edu (Greg Donovan)
Subject: Re: DICTIONARY
Followup-To: /dev/null
Summary: Create your own...
Keywords: big list o'words
Organization: none
Date: Sun, 3 Jan 1993 02:02:48 GMT

In article <1992Dec31.063802.12303@mnemosyne.cs.du.edu> sscrivan@nyx.cs.du.edu (steve scrivano) writes:
>For lack of any better place to post this, has anyone ever seen
>Merriam-Webster's Third New International Unabridged Dictionary on any
>computer platform? 
>
>Steve Scrivano
>sscrivan@nyx.cs.du.edu

If you need the dictionary for spellchecking, than construct your own.  I 
have sone just that (for another reason), and have an English dictionarydi 
that is roughly 400,000 words and a multilingual dictionary, that is 
approxiamately 1.3 million "words".  I quote the words, some of the 
entries are not true words, but short phrases (8 or less characters) 
comprised of smaller words.

Greg
donovan@udel.edu

/*
Time for a new witty quote.
*/
Newsgroups: comp.unix.questions
From: root@candle.uucp (Bruce Momjian)
Subject: Re: Breaking into Unix via modem
Organization: a consultant's basement
Date: Wed, 30 Dec 1992 02:59:55 GMT
X-Newsreader: TIN [version 1.1 PL6]

Bruce Momjian (root@candle.uucp) wrote:
: 
: Someone just told me that there is a way to break into a Unix box by
: dialing the modem, but not getting a login prompt, and somehow getting
: to Unix.
: 
: The guy who told me this was somewhat confused, so I don't take much
: stock in it, yet I am asking the Net in case he has heard of a security
: issue that I have not.

<FOLLOW UP>

I have heard nothing from the Net to substantiate this person's claims,
and have talked to him again, and he now admits that the person who told
him this was probably mistaken.

I was basically in a political situation and had to give evidence that
he was wrong.  The lack of response from the Net helped me do that. 
Thanks.


-- 
Bruce Momjian                          |  830 Blythe Avenue
root%candle.uucp@bts.com               |  Drexel Hill, Pennsylvania 19026 
  +  If your life is a hard drive,     |  (215) 353-9879(w) 
  +  Christ can be your backup.        |  (215) 853-3000(h)
Newsgroups: comp.unix.questions