HDTenEightyP/NetNews huggingface dataset:
From: merlyn@romulus.reed.edu (Randal L. Schwartz)
Newsgroups: comp.unix.questions
Subject: Re: AWK Iteration
Date: 29 Aug 92 20:41:24 GMT
Article-I.D.: romulus.MERLYN.92Aug29134120
Organization: Reed College

In article <1992Aug28.183452.2245@midway.uchicago.edu> a-douglas@uchicago.edu (Allen Douglas) writes:
   The logic is: 

   Read in to beginning of first break point (case)-(this output will be discarded)
   Start reading the first case until beginning of next case and send text of case to temporary file .
	      Process commands on temp file, output to results file(s.)
   Read in text of the next case, until the begining the next+1 case.    (replacing the previous output)

   The cases (as in legal case) have delimeters of "of 38 CASES" 


In Perl, this would be:

perl -pe 'open(STDOUT,"|some_command >result.".++$i),$_="",next if /of 38 CASES/' \
	<yoursourcefile >headertext

"headertext" will contain the stuff before the first "of 38 CASES".
"result.1","result.2"... will contain the results of running "some_command"
over each segment between "of 38 CASES".

Too easy with Perl.

print "Just another Perl hacker,"
--
Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
merlyn@reed.edu (guest account) merlyn@ora.com (better for permanent record)
cute quote: "Welcome to Portland, Oregon -- home of the California Raisins!"
From: capistra@andromeda.rutgers.edu (M. P. Capistrano)
Newsgroups: comp.unix.questions
Subject: What happens when all the inodes are exhausted?
Date: 4 Sep 92 04:39:25 GMT
Organization: Rutgers Univ., New Brunswick, N.J.


When a filesystem is created, a fixed number of inodes are allocated
for the inode list.  So, what happens when all the inodes are
exhausted then?

Thanks.
-MPC-
From: alhy@unixhub.slac.stanford.edu (J. Scott Berg)
Newsgroups: comp.unix.questions
Subject: Re: How can I allow access to a subdirectory without risking other files?
Date: 31 Aug 92 19:53:57 GMT
Reply-To: alhy@unixhub.slac.stanford.edu
Organization: Stanford University, dept of Physics / SLAC

>I know how to give group/other access to a subdirectory without risking my
>other files, however, I want people to be able to read/write to ANY file in
>the subdirectory. That includes files put there by other people.  The only way
>I know of to do this is to make sure that everyone has their umask set to 000
>when they are working in that subdirectory.

Okay, how about this:  create a user, "elvis".  Make the directory in
question owned by elvis, and have the permission be rwx for elvis
ONLY.  (Actually, you can probably make it rx for everyone else).
Then write a setuid script kinglives which contains the following lines:

cd /graceland
exec /bin/csh

or you could be fancier and try to figure out what the user's shell
actually is and exec that.  This way, (I think) nobody can write into
graceland except elvis. When a use executes kinglives, (s)he becomes
elvis and can do anything to graceland.

				-Scott Berg

-- 
-------------------------------------------------------------------------------
The opinions expressed here are, of course, my own and nobody else's.
-------------------------------------------------------------------------------
J. Scott Berg
email: alhy@unixhub.slac.stanford.edu
real mail: Varian Physics
           Stanford  CA  94305-4060
phone:	(415) 926-4732 (w)
 	(415) 326-2631 (h)
-------------------------------------------------------------------------------

Newsgroups: comp.unix.questions
From: dattier@ddsw1.mcs.com (David W. Tamkin)
Subject: Re: A question on ls
Organization: Contributor Account at ddsw1, Chicago, Illinois  60657
Distribution: na
Date: Mon, 31 Aug 1992 18:31:10 GMT
X-Disclaimer:  Material posted in this article is the sole responsibility of
                the poster and does not represent MCSNet or the system owners.

rouben@math9.math.umbc.edu (Rouben Rostamian) wrote in
<1992Aug29.233534.27967@umbc3.umbc.edu>:

| In article <6786@tekig7.PEN.TEK.COM> naren@tekig5.pen.tek.com (Naren Bala)
| writes:

| >What command would I type to display all files that do not have a .Z 
| >extension ?

| The wildcards are expanded by the shell, so the answer is: it depends on
| the shell you are using.  In tcsh, you type:
| % ls ^*.Z
| In sh and csh you are out of luck.  In other shells, I don't know.

In ksh, ls -d !(*.Z) .!(*.Z)

In sh, you aren't very far out of luck:

ls -d `for i in .* *
do
  case $i in
  *.Z|.*.Z) ;;
  *) echo $i ;;
  esac
done`

The sh running here under Dell SVR4 doesn't consider initial periods special
for pattern matching with "case", so *.Z) ;; is enough without |.*.Z, but
your sh's mileage may very.

David W. Tamkin   Box 59297   Northtown Station, Illinois  60659-0297
dattier@ddsw1.mcs.com    CompuServe: 73720,1570    MCI Mail: 426-1818
Newsgroups: comp.unix.questions
From: anthony@kurango.cit.gu.edu.au (Anthony Thyssen)
Subject: Re: Problems with stray xterm client processes...
Organization: Griffith University, Brisbane, Australia.
Date: Tue, 1 Sep 92 06:09:34 GMT

espiritu@cgi.com (Rex Espiritu) writes:
| This problem arises when a user logs out of one of our Sun SPARCstations
| where they had "xterm" clients running when they logged out.
|
| What happens then is the "xterm" clients of another user (on the same
| machine) seems to then start sharing the same pseudo device that the
| other user had.  The second user can do a "whoami" and they will get a
| response of the other user.  It seems that every other command is
| executed under the other users "uid".

Yes we have been experancing the same problem. However we also discovered
that if a X11 R5 xterm is killed using a ``delete window'' signal from the
window manager any process (other than the shell itself) that was running
under that xterm is also left behind, to the detrement of anyone that
picks up the old pty later.

If a ``kill window'' signal is used however, the xterm cleans up properly.
Under revision 4 the xterm ignores the ``delete window'' and only exits on
a kill window or exit of the client shell, so no problem was experanced.

I have reported this a number of times but have yet to recieve even a
recept of the report.


  Anthony Thyssen - (CIT, Griffith University)       anthony@cit.gu.edu.au
------------------------------------------------------------------------------
   Judgment comes from experience: experience comes from poor judgment.
------------------------------------------------------------------------------
From: tmilner@hprpcd.rose.hp.com (Tom Milner)
Date: Mon, 31 Aug 1992 19:46:25 GMT
Subject: Re: Question about date.
Organization: Performance Technology Center, Roseville
Newsgroups: comp.unix.questions

In comp.unix.questions, simony@ccs.northeastern.edu (Simon Yeung) writes:


|    I am writing a C shell script in which the user enter a number n
|    and the script needs to find the date which is the nth day before
|    the current date.  Can I do this by using some Unix commands?
|
|    I don't want to write a program for it, unless I have to.
|
|    Thanks.
|
|    --Simon

I believe something VERY similar was posted before...

|>
|>I could sit down and take the brute-force approach and hard-code a bunch
|>of cases, but I'm looking for something more simple. I've noticed that
|>you can go "at now + 3 days ..." and you get the date/time back (but
|>you also get an at job put in the queue...) so I was thinking that there
|>may be a system call or C function that I don't know about which does
|>this. So, any suggestions, please email and I'll post a summary if there
|>is interest.
|
|You could change your location. You move 15 degrees about the earth as
|you add or subtract 1 to or from your TZ. And space and time are equivalent,
|no?
|
|Play with this script:
|
|        set -v
|        TZ=5 date
|        TZ=-19 date
|        TZ=-43 date
|        TZ=-163 date
|
|What it shows me:
|
|        TZ=5 date
|        Fri Jul 17 20:46:58  1992
|        TZ=-19 date
|        Sat Jul 18 20:46:58  1992
|        TZ=-43 date
|        Sun Jul 19 20:46:58  1992
|        TZ=-163 date
|        Fri Jul 24 20:46:58  1992
|--
|Jean-Pierre Radley   Unix in NYC   jpr@jpr.com   jpradley!jpr   CIS: 72160,1341

                                  _____________________________________
                                 /_______________  ___________________/
                                                / /
                                               / /
                                              / / Tom Milner (Tn: 785-5637)
                                             / /  HP Performance Tech Center
                                            / /   tom@hpptc16.rose.hp.com
                                           /_/    __________________________
From: capistra@andromeda.rutgers.edu (M. P. Capistrano)
Newsgroups: comp.unix.questions
Subject: Question on WAKE UP call...
Date: 4 Sep 92 04:34:52 GMT
Organization: Rutgers Univ., New Brunswick, N.J.


What should happen if the kernel attempts to wake up all processes sleeping
on an event, but no processes are asleep on the event at the time of the
wakeup?

Thanks.

-MPC-
From: aakash@hpcupt3.cup.hp.com (Aakash Sahai)
Date: Thu, 27 Aug 1992 17:51:51 GMT
Subject: Re: How to prevent a large core-dump
Organization: Hewlett Packard, Cupertino
Newsgroups: comp.unix.questions

In article <1992Aug25.173056.13401@utwente.nl> soos@math.utwente.nl (Adwin Soos) writes:
| A few weeks or even months ago I have read some discussion about the problem
| of preventing a core-dump.

Two simple solutions are -

(i)	Run the core-dumping program from a directory where the user does
	not have permission to create file.

(ii)	Set the Effective-User-ID of the program different from its
	Real-User-ID.

-- Aakash
From: guy@Auspex.COM (Guy Harris)
Newsgroups: comp.unix.questions
Subject: Re: logout message
Date: 27 Aug 92 21:45:29 GMT
Organization: Auspex Systems, Santa Clara

> Can anyone tell how to display some message when I logout?

Several people apparently can; however, not all of them are telling the
original poster the same thing.

The "trap 0" answer is for users of the Bourne shell and compatibles
(Korn shell, Bourne-again shell, etc.).

The ".logout" answer is for users of the C shell and compatibles.

Remember, your environment might not be the same as the original
poster's (different shell, different UNIX flavor, etc.).
Newsgroups: comp.unix.questions
From: fitzgb@mml0.meche.rpi.edu (Brian Fitzgerald)
Subject: Re: changing name of core file
Organization: Rensselaer Polytechnic Institute, Troy, NY
Date: Fri, 4 Sep 1992 15:26:09 GMT

Dan Stanger writes:
>does anyone know how to change the name of the core file that will be
>created if a program fails.  we have several programs running in the

Not without kernel sources.

>same directory so if more than one of them fails the core file from
>one overwrites the other.  we would like to change the name to
>program.core or somthing like that.

Run the program as:

program ; mv core program.core

When "program" exits, then if "core" exists, it is renamed.

This is the idea, anyway.  You want a fancier shell script.

#!/bin/sh
program || test -f core && mv core program.core

is a little better, but there's no assurance that you are renaming
the right core file.

Brian
From: dev@mentor.cc.purdue.edu (Larry Weeks)
Newsgroups: comp.unix.questions
Subject: SUMMARY: Smiley list
Date: 25 Aug 92 16:52:54 GMT
Distribution: usa
Organization: Purdue University Computing Center

dev@mentor.cc.purdue.edu (Larry Weeks) once wrote: 
> Hi,
>
> Could some kind soul out there send me a copy of the canonical smiley
> list, or whatever version they may have. Reply by email, please,
> since I don't really read this group. Thanks.

I have gotten two smiley lists so far, so if anybody wants a copy,
send me a request... Thanks a lot.

Larry
--
Larry Weeks        | "Who am I? I am a tiny speck in history. I see my
dev@ecn.purdue.edu |  name engraved in front of me. Today I know who I
-------------------+  will be. I see my fate in front of me. I'll be
 yours. I'll be yours from now until eternity. I can see that now you
 are my destiny." -- B.A.M.V.A.
Newsgroups: comp.unix.questions
From: a-douglas@uchicago.edu (Allen Douglas)
Subject: AWK Iteration
Organization: U of C  Law School
Date: Fri, 28 Aug 1992 18:34:52 GMT

Hello,
I need to get the shell or awk to take a large file and pipe segments 
to a temporary file where I can then run some awk or agrep commands 
(on the temporary file.)   The file is a collection of legal cases, 
delimited by "of 38 CASES" I want to awk/agrep the individual cases 
and output to a results file.


The logic is: 

Read in to beginning of first break point (case)-(this output will be discarded)
Start reading the first case until beginning of next case and send text of case to temporary file .
	   Process commands on temp file, output to results file(s.)
Read in text of the next case, until the begining the next+1 case.    (replacing the previous output)

The cases (as in legal case) have delimeters of "of 38 CASES" 


I haven't been able to fathom the syntax, as I am very green programming Unix. 

Newsgroups: comp.unix.questions
From: dbsuthe@pbhya.PacBell.COM (Daniel B. Suthers)
Subject: Re: how come : ! out of vi always uses sh instead of $SHELL ???
Reply-To: dbsuthe@PacBell.COM (Daniel B. Suthers)
Organization: Pacific * Bell, San Ramon, CA
Date: Thu, 27 Aug 1992 23:27:56 GMT

fish@daacdev1.stx.com writes:
>: whenever i :! out of vi it uses /bin/sh instead of $SHELL
>: so all of my aliases are lost, etc and makes it very limited


Checking the source for VI on our SVR3 machine shows that VI uses the
execl(2) call to run sub-shells.  It incorrectly uses the hardcoded 
string "sh" as the second argument to that call.  This means that the
shell you use THINKS it was invoked as "sh", as this is what's in ARGV[0].

It actually uses whatever is in your (vi) shell variable.  This variable is
loaded from a getenv() call and possibly overwritten by your EXINIT string.

Now, to address the complaint: Aliases are lost because aliases are not
passed to child processes.  This applies to Bourne and KSH.  I don't
know about CSH.

My solution is to have all of my aliased commands backed up as shell
commands.  This allows a reasonable environment whether in a subshell or
not.

Daniel B. Suthers,  CCP
Technology Consultant, PCS & IN Development Lab,        Pac*Bell
Voice: (510) 671-1325               UUCP:  dbsuthe@Pacbell.COM
================================================================================
=  Commit unexpected kindnesses and senseless acts of beauty.                  =
================================================================================
From: brijesh@tzu.sybase.com
Newsgroups: comp.unix.questions
Subject: uncompressing an incomplete tar file
Date: 28 Aug 92 21:53:57 GMT

Here is what I did:

1) TARed a directory => foo.tar
2) compress foo.tar  => foo.tar.Z (~200 Meg)
3) TARed it onto a tape (~150 Meg)
4) read the file foo.tar.Z from tape drive (~150 Meg)
5) uncompress foo.tar.Z => foo.tar (only ~2 Meg!!)

so after uncompressing I am not getting back rest of my stuff.
The only thing I think that may be wrong is at step 3, two tapes
could not contain entire 200Meg, so only ~150 Meg got stored
which may be causing problems for later uncompress.

what i am looking for is some sort of way to recover the data.
does anyone have the source for uncompress.c?  I could then maybe
hack something with it to handle this situation.

any help is appreciated.
Newsgroups: comp.unix.questions
From: hamilton@vine.cp10.es.xerox.com (Bruce A. Hamilton)
Subject: How do I umount a bogus "device busy" CD-ROM?
Organization: Xerox Corp., El Segundo, CA, USA
Date: Wed, 26 Aug 1992 21:45:55 GMT

Nobody is using /cdrom, but when I try to umount it, I get
"/cdrom: device busy".  SS2, SunOS 4.1.1b.  Surely there's a way
to force a umount without rebooting?

Thanks,
-- 
--Bruce
BHamilton.LAX1B@Xerox.COM
310/333-3538
Xref: sparky comp.unix.questions:10731 comp.unix.wizards:3795
From: c0408982@techst02.technion.ac.il (Michael Gleibman)
Newsgroups: comp.unix.questions,comp.unix.wizards
Subject: Modem number access from UNIX system
Date: 4 Sep 92 15:15:49 GMT
Organization: Technion, Israel Inst. of Technology

Hello! 
Does anybody here knows how can I access the modem number from VAX (BSD4.3)
Thanx in advance. Any help is appreciated.

-- 
                        Michael Gleibman,
Dept. of Mathematics, Technion, Haifa, Israel,
e-mail: c0408982@techst02.technion.ac.il
Phone: (0972)(8)543820
From: rpinder@phad.hsc.usc.edu (Rich Pinder)
Newsgroups: comp.unix.questions
Subject: AWK - calculate check sum for zip+4....
Date: 26 Aug 1992 21:32:01 -0700
Organization: University of Southern California, Los Angeles, CA
Distribution: world
NNTP-Posting-Host: phad.hsc.usc.edu

HELP!

You know the saying 'nothing changes, but everything changes' ....

I had a code segment working fine in an AWK script to calculate a
Zip-plus-4 check code for use with a barcoding project.  Then I
lifted the same segment, changed the referenced variables (in the
original I was substr(ing) the $0, and now i'm referring to the
variable as $5) but am now getting some strange error - looks like my
calculated variable (check) isn't getting reset after each iteration
of the step:


stand-alone code segment that DOEWN't work:

awk -F '|' '	{		 
		OFS="|";
		for (i=1; i<=length($5); i++)
		a += substr($5,i,1);
		check=10-(a-(10*(substr(a,1,1))));
		if (check==10) check=0;


		print($1,$2,$3,$4,$5,check,$7);

		} ' $*


......
sample of the input file:

73203587 | |738 W GOLDEN ST # 5 |LOS ANGELES CA 90017 |90017 |3|1
60120617 | |2785 PACIFC CST HWY |TORRANCE CA 90505 |90505 |1|1
60120618 | |2785 PACIFC CST HWY |TORRANCE CA 90505 |90505 |1|1
61127392 | |2717 VIA ACORONA |MONTEBELLO CA 90640 |90640 |1|1
47051664 | |CYM BERTH 202 #17 |WILMINGTON CA 90744 |90744 |6|2
60120233 | |938 COLIMA |AZUSA CA 91702 |91702 |1|1
58106166 | |3726 FOSTER |BALDWIN PARK CA 91706 |91706 |7|1
49059900 | |2395 F |CARLSBAD CA 92009 |92009 |0|1
57097895 | |10737 S D MSN RD # 105 |SAN DIEGO CA 92108 |92108 |0|1
62135984 | |512 S ROSWELL ST |SAN DIEGO CA 92114 |92114 |3|1
73203587 | |738 W GOLDEN ST # 5 |LOS ANGELES CA 90017 |90017 |3|1


sample of the output file (see $6 in line 5):

60120617 | |2785 PACIFC CST HWY |TORRANCE CA 90505 |90505 |4|1
60120618 | |2785 PACIFC CST HWY |TORRANCE CA 90505 |90505 |5|1
61127392 | |2717 VIA ACORONA |MONTEBELLO CA 90640 |90640 |6|1
47051664 | |CYM BERTH 202 #17 |WILMINGTON CA 90744 |90744 |2|2
60120233 | |938 COLIMA |AZUSA CA 91702 |91702 |-97|1
58106166 | |3726 FOSTER |BALDWIN PARK CA 91706 |91706 |-120|1
49059900 | |2395 F |CARLSBAD CA 92009 |92009 |-140|1
57097895 | |10737 S D MSN RD # 105 |SAN DIEGO CA 92108 |92108 |-160|1
62135984 | |512 S ROSWELL ST |SAN DIEGO CA 92114 |92114 |-177|1


heres a code section that DID work just fine
...stuff deleted
	{

	zipplus=substr($0,469,9);
	addform=substr($0,486,30);
	cityform=substr($0,516,30);
#  Calculate the check digit, and output as seperate (6th) variable
		for (i=1; i<=length(zipplus); i++)
		a += substr(zipplus,i,1);
		check=10-(a-(10*(substr(a,1,1))));
		if (check==10) check=0;

print(id,name,addform,cityform,zipplus,check) > "caltwin.mail";
	}

......stuff deleted




Its late, i'm behind a deadline, and it may be something very simple....

I appreciate any thoughts you have....



		Rich Pinder
		USC School of Medicine
		(213) 342-1640

		rpinder@usc.edu

    ||||||||||||||||||||||||||||||||||||||||||||||||||
-- 


Rich
From: shah@fnsony.fnal.gov (Hemant Shah)
Newsgroups: comp.unix.questions
Subject: Re: logout message
Date: 27 Aug 92 17:47:02 GMT
Reply-To: shah@fnalb.fnal.gov
Organization: Fermi National Accelerator Laboratory, Batavia, IL

In article <3504@babcock.cerc.wvu.wvnet.edu>, hongman@cathedral.cerc.wvu.wvnet.edu (Guo Hongman) writes:
|> 
|>  Can anyone tell how to display some message when I logout?

Create ".logout" file in your home directory. It will be executed when you
logout.
-- 
-------------------------------------------------------------------------------
Hemant Shah                            | All the opinions expressed are my own
Fermi National Accelerator Laboratory  | and does not necessarily reflect
Systems Integration Group              | those of Fermilab.
E-mail :shah@fnal.fnal.gov             |
 Voice : (708) 840-8071	               | I haven't lost my mind
   Fax : (708) 840-2783                | it's backed on tape somewhere.
-------------------------------------------------------------------------------
From: guy@Auspex.COM (Guy Harris)
Newsgroups: comp.unix.questions
Subject: Re: A question on ls
Date: 30 Aug 92 23:28:41 GMT
Distribution: na
Organization: Auspex Systems, Santa Clara

>=What command would I type to display all files that do not have a .Z 
>=extension ?
>
>ls *[!.][!Z]

What shell will display *all* files that do not have a ".Z" extension
with such a command?

Not the SunOS 4.1.1 Bourne shell (essentially the SVR3.1 Bourne shell),
and not the "ksh-88" version of the Korn shell:

	bootme$ ls
	foo.Z           foo.c           fooZ            foofoofoo       x
	bootme$ ls *[!.][!Z]		# ksh-88
	foofoofoo
	bootme$ /bin/sh			# 4.1.1 Bourne shell
	bootme$ ls *[!.][!Z]
	foofoofoo

They may list "foofoofoo", but they don't list "foo.c" (which doesn't
have a ".Z" extension), nor "fooZ" (which doesn't have a ".Z"
extension), nor "x" (which doesn't have a ".Z" extension).

To quote the 4.1.1 SH(1) manual page (essentially an SVR3-vintage manual
page):

  Filename Generation
     Before a command is executed, each command word  is  scanned
     for the characters `*', `?', and `['.  If one of these char-
     acters appears the word is regarded as a pattern.  The  word
     is  replaced with alphabetically sorted filenames that match
     the pattern.  If no filename is found that matches the  pat-
     tern,  the word is left unchanged.  The character `.' at the
     start of a filename or immediately following a `/', as  well
     as the character `/' itself, must be matched explicitly.

          *    Matches any string, including the null string.
          ?    Matches any single character.
          [...]
               Matches any one of  the  enclosed  characters.   A
               pair  of  characters  separated by `-' matches any
               character lexically between the  pair,  inclusive.
               If  the first character following the opening [ is
               a ! any character not enclosed is matched.

Sounds to me as if:

	1) "[!.]" matches any character that's not a ".", but will not
	   match nothing, just as "[!Z]" matches any character that's
	   not "Z", but doesn't match nothing.  Thus, "[!.][!Z]" doesn't
	   match any name that has fewer than 2 characters, e.g. ".x".

	2) "*[!.][!Z]" matches anything that doesn't have "." as its
	   next-to-last character and that doesn't have "Z" as its last
	   character - emphasis on the "and".  I.e., it doesn't match
	   anything with "." as its next-to-last character, even if it
	   doesn't have "Z" as its last character (e.g., "foo.c"), and
	   doesn't match anything with "Z" as its last character, even
	   if it doesn't have "." as its next-to-last character (e.g.,
	   "fooZ").
From: NEWCOMER%DICKINSN.bitnet@cunyvm.cuny.edu (Newcomer, Don)
Newsgroups: comp.unix.questions
Subject: C-Kermit
Date: 31 Aug 92 20:21:44 GMT

I've already posted to Info-Kermit with no success so I thought I'd try here.
I'm trying to build C-Kermit under Sequent's Dynix/ptx v1.4.0 and have had no
success whatsoever.  The Kermit version is 4E(072) and this version has
already worked on my DECstation 3100 running Ultrix.  I've tried 'make bsd'
(which I was relatively positive wouldn't work) and 'make sys5' and both
encounter errors.  Has ANYONE on the list successfully run C-Kermit under
this version of ptx?  Thanks.

                                        Don Newcomer
                                        NEWCOMER@DICKINSON.EDU
                                        Dickinson College
                                        Carlisle, PA  17013
Newsgroups: comp.unix.questions