HDTenEightyP/NetNews huggingface dataset:
From: jerry@incc.com (Jerry Rocteur)
Newsgroups: comp.unix.shell
Subject: Re: file removal problem solved.
Summary: oonce and for all, removing files
Date: 29 Aug 92 20:08:07 GMT
Organization: InCC.com Perwez Belgium

In article <ls91Hct!99@atlantis.psu.edu>, barr@pop.psu.edu (David Barr) writes:
> In article <FRIEDMAN.92Aug29010851@nutrimat.gnu.ai.mit.edu> friedman@gnu.ai.mit.edu (Noah Friedman) writes:
> >In article <BtMJuK.KEH@acsu.buffalo.edu> vidya-v@acsu.buffalo.edu (vidyaranya) writes:
> >>The solution I finally used came from our system administrator.  I had
> >>already tried the 'rm -i' and rm A* options and posted when they failed.
> >>
> >>The solution I used needed a simple C program and an Octal
> >>dump of the filename to specify in the C program.
> >>Here it is:
> >>
> >>[ bletcherous C program mercifully deleted ]
> >
> >
> >   Your system ambiguator ought to be shot. 
> 
> Agreed!  Talk about attacking the problem in a roundabout way!
> 
> Don't you guys have emacs?   (I've only had to use "emacs ." once,
> but it's handy to know that it's there.)
 
 This is all so tiresome pleaaaaaaase, Eric Liman summed it all up in
 a post on Aug 27th, this should be posted on a daily basis, that way
 we would not have to repeatedly read these stupid questions and often
 answers, here is Eric's post, read it, print it and paste it on the
 wall, please..........

>Interesting that one would go through such an elaborate method. You could
>have:
>
>[~elitman] elitman@phenom(ttyp3)
>
> 11:36am -# /bin/ls -i
>
> 16809 Apps			32537 Library
> 48329 Mailboxes		54133 MusicInfo
> 42487 bin			66595 dead-cube
> 20875 foo&bar			20864 letter-to-UK
> 20861 promos.tar.F		20892 utilsnmail.tar
>
>[~elitman] elitman@phenom(ttyp3)
>
> 11:36am -# find . -inum 20875 -exec rm {} \;
>
>[~elitman] elitman@phenom(ttyp3)
>
> 11:37am -# /bin/ls -i
>
> 16809 Apps                     32537 Library
> 48329 Mailboxes                54133 MusicInfo
> 42487 bin                      66595 dead-cube
> 20864 letter-to-UK		20861 promos.tar.F
> 20892 utilsnmail.tar
>
>Why bother with something as bloated as a C program when this will accomplish
>exactly the same thing?
>
>--
>Eric A. Litman  #import <std/disclaimer.h> | NeXTMail, MIME accepted - please 
>U. of Maryland, NeXT Campus Consultant     | indicate in Subject line.


  IN OTHER WORDS, DO AN ls -i OF THE PROBLEM FILE, STAY WITHIN THAT
  DIRECTORY, DO A find . -inum nnnn -exec rm {} \; WHERE nnnn IS THE
  NUMBER DISPLAYED TO THE LEFT OF YOUR FILES NAME, AND THAT IS IT,
  YOUR PROBLEM FILE IS DELETED...................

-- 
 __^__                                                              __^__
( ___ )------------------------------------------------------------( ___ )
 | / | Jerry Rocteur                       Email: jerry@InCC.COM    | \ |
 |___|  Independent Computer Consultants division DELDRA s.p.r.l.   |___|
(_____)------------------------------------------------------------(_____)
   ^                                                                  ^
Newsgroups: comp.unix.shell
From: Harald.Eikrem@delab.sintef.no
Subject: Re: How to empty a file
Organization: SINTEF DELAB, Trondheim, Norway.
Date: 26 Aug 92 17:22:28

! >> I'd like to empty a log file after extracting what I need from it so that
! >> the next day's data can fill it up a-fresh.  The file must exist after
! >> emptying it.
! 
! cp /dev/null <logfile>
! 
! /laura

This is definitely a FAQ.  My favourite file making/nulling command is:

  : > file

which should work from any kind of shell (in csh "noclobber" must be
neutralised).  This construct does not depend on

     1) another program (cp, cat, ...)
     2) /dev/null


  ~~harald E.
Newsgroups: comp.unix.shell
From: boyd@prl.dec.com (Boyd Roberts)
Subject: Re: Octal chmod status
Organization: Digital Equipment Corporation - Paris Research Laboratory
Date: Wed, 26 Aug 1992 10:17:14 GMT

In any case, chmod(1) should be fixed to conform to the school of
thought of `programming the inputs', eg:

    chmod -rwxr-xr-x file

does the same as:

    chmod 755 file

It should ignore the leading file type character, ie -pds etc.


Boyd Roberts			boyd@prl.dec.com

``When the going gets wierd, the weird turn pro...''
Newsgroups: comp.unix.shell
From: john@physiol.su.OZ.AU (John Mackin)
Subject: Re: Help with directories!
Organization: Department of Physiology, University of Sydney, Australia
Date: Wed, 26 Aug 1992 02:39:09 GMT

In article <ASH.92Aug25094554@ulysses.mr.ams.com>,
	ash@ulysses.mr.ams.com (Alan Harder) writes:

> This seems like a legitimate question for comp.unix.shell.  If the
> question bothers you, don't answer it.  Otherwise, let's not
> discourage people from asking questions on this group.  After all,
> it's comp.unix.shell, not comp.unix.shell.wizards.

Oh dear.

You all seem to be missing Boyd's point.  Or have you, too, only
been reading this group for three minutes?

His point (if I may be permitted) was that we _just had_ a thread
about `how do I convert symbolic permissions to octal'.  Like last
week.

The consensus in that thread, by the way, was that you don't need
to do this.

Of course it's a legitimate question.  And all of us who have been
reading netnews for longer than three minutes know that threads
continually recycle.  But it's also legitimate to be peeved when
a thread recycles _that quickly_.

-- 
John Mackin <john@civil.su.oz.au>
`I'm not easily impressed on Mondays.'  -Bruce Ellis
Xref: sparky comp.unix.shell:3734 comp.unix.questions:10610
From: root@steiny.com (Admin)
Newsgroups: comp.unix.shell,comp.unix.questions
Subject: Re: Shell Scripts vs. C programs
Keywords: shell script, C
Date: 1 Sep 92 15:21:43 GMT
Organization: Don Steiny Software

navarra@casbah.acns.nwu.edu (John Navarra) writes:

>In article <119@steiny.com> steiny@steiny.com (Don Steiny) writes:
>>nurban@tjhsst writes:
>>
>>
>>>I've heard that if at all possible, code a program as a shell script
>>>rather than coding it in C.  Can someone explain the rationale behind
>>>this philosophy?
>>
>>	BZZZ - shell scripts are non-portable
>>
>	Huh? Why are shell scripts non-portable? Unless you are using
>a non-standard shell, shell scripts are HIGHLY portable! 

	The shell may be, but the utilities that the shell calls in order
to operate are not, thus, shell scripts are non-portable.   Believe me,
I had to write a distribution package for software that runs on many machines.
I eventually had to re-write it in C because the shell was so non-portable.
Many other posters to this thread have also had this experience.   The
only reason that you think that is because you have not had much experience
trying to port shell scripts.

>> there is no error checking,

>	There isn't? What does this mean? You write error checking
>into the shell program just like you write it into C program. 

	If you accidently misspell a variable name, then the shell simply
takes it as a decleration.     In the 14 years I have been working 
professionally with UNIX I have witnessed numerous attempts to write
substantial applications in the shell and they have all failed.

>>and they have many other problems.
>	And translating your C code using compiler X to OS Y is any
>easier? Perhaps you are thinking of Csh? Then, yeah, you suck. 

	Are you saying that the shell runs in more environments than 
C compilers?

>>For very short programs shell 
>>might be better, but in general C is better for many reasons.

>	Even for long programs, shell scripts can be better. Yes, they
>will run slower but if you can saves days, weeks, or months writing
>the shell script, which is better then? 

	Why would that be, if you did not know C?    Why not use perl?  It
is supported on more machines than the shell, it has error checking, it
is portable, and it so much better than the shell it boggles the mind.


> It generally takes much longer
>to write the same code in C as it does in a shell, perl, or awk. And,
>once you have that script written, it is generally trivial to port it
>to another machine -- especially if that machine runs the SAME SHELL!

	And has the exact same semantics for all of the commands. In other 
words, you are not trying to port a shell script from AT&T to BSD.   

	Besides, if you really know C it is as fast to write many things 
as the shell.   For text processing, use perl.   The shell stinks as 
a programming language for anything but short interactive programs.

-don
Newsgroups: comp.unix.shell
From: dattier@ddsw1.mcs.com (David W. Tamkin)
Subject: Re: file removal problem solved.
Organization: Contributor Account at ddsw1, Chicago, Illinois  60657
Date: Mon, 31 Aug 1992 18:39:13 GMT
X-Disclaimer:  Material posted in this article is the sole responsibility of
                the poster and does not represent MCSNet or the system owners.

jerry@incc.com (Jerry Rocteur) wrote in <114.22393@incc.com>:

|  This is all so tiresome pleaaaaaaase, Eric Li[t]man summed it all up in
|  a post on Aug 27th, this should be posted on a daily basis, that way
|  we would not have to repeatedly read these stupid questions and often
|  answers, here is Eric's post, read it, print it and paste it on the
|  wall, please..........

[Rocteur's citation of Litman's example deleted]

|   IN OTHER WORDS, DO AN ls -i OF THE PROBLEM FILE, STAY WITHIN THAT
|   DIRECTORY, DO A find . -inum nnnn -exec rm {} \; WHERE nnnn IS THE
|   NUMBER DISPLAYED TO THE LEFT OF YOUR FILES NAME, AND THAT IS IT,
|   YOUR PROBLEM FILE IS DELETED...................

Almost; if the funny name is an extra link to a valuable file whose other
link is/links are in or under the same directory, use -ok as Jean-Pierre
Radley suggested instead of -exec.

David W. Tamkin   Box 59297   Northtown Station, Illinois  60659-0297
dattier@ddsw1.mcs.com    CompuServe: 73720,1570    MCI Mail: 426-1818
From: uekleinf@mcs.Drexel.edu (Erik Kleinfelder)
Newsgroups: comp.unix.shell
Subject: Re: Help with directories!
Date: 25 Aug 92 18:30:33 GMT
	<1992Aug24.195943.2766@prl.dec.com>
	<ASH.92Aug25094554@ulysses.mr.ams.com>
	<1992Aug25.142330.13023@news.eng.convex.com>
Organization: Drexel University


Tom> :This seems like a legitimate question for comp.unix.shell.  If the
Tom> :question bothers you, don't answer it.  Otherwise, let's not
Tom> :discourage people from asking questions on this group.  After all,
Tom> :it's comp.unix.shell, not comp.unix.shell.wizards.

Tom> But we discussed it ad nauseum just five days ago!!

Tom>     Tom Christiansen      tchrist@convex.com      convex!tchrist

     True, but how about putting stuff like this in a FAQ -- Simple scripting
solutions, or something like that.  I have noticed that quite a few things
come into this group that are very useful, but even the "wizard" shell
questions get asked multiple times.  I usually save articles that seem to use
ingenious solutions to problems, but I would like to see(and others I suppose),
a post of multiple, NOT lengthy, scripting ideas and solutions.

     My reason for asking this is because I have not seen a FAQ let a lone
a pertinent FAQ with these this type of setup.

Erik

-------------------------------------------------------------------------------
Erik Kleinfelder		uekleinf@mcs.drexel.edu
Computer Science		Math and Computer Science Department
Undergrad			Drexel University
Newsgroups: comp.unix.shell
From: prt7u@holmes.acc.Virginia.EDU (Peter R. Thorsen Jr.)
Subject: Any known bugs for tcsh (6.02)
Organization: University of Virginia
Date: Fri, 4 Sep 1992 16:24:03 GMT

Folks,

I just compiled tcsh-6.02 and was wondering if there were any
known bugs and if so what they are for this particular version.

It would really help a lot and save me a lot of time testing
everything.

Please e-mail me with any information.

Thanks a lot,

Pete Thorsen - prt7u@virginia.edu
-- 

                       It's better to be dead and cool
                       then alive and uncool...       
                    Harley Davidson and the Marlboro Man
Newsgroups: comp.unix.shell
From: Harald.Eikrem@delab.sintef.no
Subject: Re: How to empty a file
Organization: SINTEF DELAB, Trondheim, Norway.
	<1992Aug26.172228*Harald.Eikrem@delab.sintef.no>
	<1992Aug27.090806.18989@physiol.su.OZ.AU>
Date: 29 Aug 92 12:53:06

john@physiol.su.OZ.AU (John Mackin)'s correction to something I said:
! > This is definitely a FAQ.  My favourite file making/nulling command is:
! >
! >  : > file
! >
! > which should work from any kind of shell (in csh "noclobber" must be
! > neutralised).
! 
! Wrong again.  Nothing says this "should work from any kind of shell".
  ^^^^^^^^^^^

Does this imply that most things I say is "wrong" in your eyes?

! It will work from any kind of shell that has : as a functional comment
! character (or, if you want to look at it that way, as a builtin
! command that ignores its arguments and doesn't do anything).

Yeah, the `:' command was meant to be a null command (do nothing, or
"noop" as some ancient assembler languages probably would have it) which
in the normal case returned status 0, exactly like the functional effect
of the `true' command, except `:' is a builtin.  The shell still expands
variables and performs i/o redirects.  However, in csh (and tcsh) the `:'
command is only useful for doing redirects, it will not accept arguments,
which is a pity.

! Not all shells have that.  One example of a shell that doesn't is rc.

So why did the designers/implementors of rc chose not to make `:' a null
command?  Is there a null command in rc?

! If you really want something that "should work from any kind of
! shell", and you aren't happy with "cat /dev/null >target", then
! use
! 
! 	sh -c '> target'
! 
! All that depends on is that you have sh, and that single quotes
! work as expected in the shell in use.

In lack of :, the simplest *general* file nulling command should be

   true > file

or, in lack of a `true' command:

   sh -c : > file

:> :> :)

Enough of this.

  ~~harald E.
Newsgroups: comp.unix.shell
From: chris@ctmnix.UUCP (Chris Matthews)
Newsgroups: comp.unix.shell
Subject: Re: Help with directories!
Date: 27 Aug 92 23:48:29 GMT
Reply-To: chris@ctmnix.UUCP (Chris Matthews)
Organization: Underground Nixbox Creations

In article <1992Aug26.031742.12476@aplcen.apl.jhu.edu> bandy@aplcen.apl.jhu.edu (Mike Bandy) writes:
  >ericd@synoptics.com (Eric Davis) writes:
  >
  >>I am looking for a sh routine to return a numerical value for a file/directory.
  >>i.e. the files permissions are -rwxr-xr-x it would return a 755.
  >
  >>Thanks
  >>Eric
  >
  >>P.S. If there is a way to do it with an existing utility, please let me know.
  >
  >I've just read 18 messages regarding this question.  And not one of them
  >  told us the answer (to which I'm curious or I wouldn't have wasted your
  >precious time with this message)...  Give us a break, and the answer to the
  >
  >	Mike Bandy
  >	Johns Hopkins University / Applied Physics Lab

Is this guy still out there?   
Eric, if your still receiving news posting from this news group, please
contact someone who has archived most of the recent news-postings or
better yet, contact your newsadmin.

Ps  Just filter what these guys are saying.   Like mentioned in an article
a few posts ago, and like whats stated in the FAQs,  do a little reading
before posting..

chris
Genisys Corp.

Newsgroups: comp.unix.shell
From: navarra@casbah.acns.nwu.edu (John Navarra)
Subject: Utility to change file permissions to octal number
Keywords: duck and cover!!!!!!!
Organization: Northwestern University, Evanston Illinois.
Date: Sat, 29 Aug 1992 04:38:25 GMT

 	Does anyone out there know an easy way to change the file
permissions (rwxrwxrwx) for a given file to the corresponding octal
numbers?

..............ahhhhhhhhh just kidding, just kidding!!!!!!!
[whack whack whack !#$%^&&&&%% holy SH****T &%$@!! help, weeeeeez] 


ok, let's all get back to work now. ;-)

-tms
 
-- 
You can get further with a kind word | You can get further with a kind word
and a gun than a kind word alone.    | and a phaser than a kind word and a gun.
          --al capone                |           -- John Navarra
=======From the Lab of the MaD ScIenTIst....navarra@casbah.acns.nwu.edu========
Newsgroups: comp.unix.shell,comp.unix.questions
From: navarra@casbah.acns.nwu.edu (John Navarra)
Subject: Re: Shell Scripts vs. C programs
Keywords: shell script, C
Organization: Northwestern University, Evanston Illinois.
Date: Thu, 3 Sep 1992 07:20:33 GMT

In article <1992Sep1.175031.3612@unx.ucc.okstate.edu> martin@datacomm.ucc.okstate.edu (Martin McCormick) writes:
>
>I always thought you should code your program in C because it executes so
>much faster.  Since I am a beginner at C, I always code in shell scripts,
>when possible, but that is mainly because it is easier to read, later.
>I would like to see the answers to this question posted to the group.
>
	I think you will find, Martin, that many times most of the work
you do falls into fairly simple catagories:

        1) work aimed at solving an immediate problem
        2) work aimed at solving a recurring problem numerous times
        3) work you have time to sugar-coat.

I find that most of the work I do falls into the first two catagories.
In the first, I want a quick fix; I write a quick shell script; I disgard
it later. It would have taken me longer to write the C code. In the 
second, I usually find it much quicker and easier to write and maintain
the shell script even though I may use it many times. When the combined
execution times of the shell script outdistance the time it takes to 
write the equivalent C program , then I might have lost ground. However,
I find that once I have a working solution I am not so inclined to 
rewriting that solution because other problems would be beating on my
door. 

That brings us to the last case. And sure, if you have time to sugar-coat,
you probably have a life! (you know: a wife, kid, dog, car, home, credit
rating, etc etc.) Time to live the good life! ;-)
 

-tms 
-- 
You can get further with a kind word | You can get further with a kind word
and a gun than a kind word alone.    | and a phaser than a kind word and a gun.
          --al capone                |           -- John Navarra
=======From the Lab of the MaD ScIenTIst....navarra@casbah.acns.nwu.edu========
From: gsa@alcor.concordia.ca ( CON U GRADUATE STUDENTS' ASSOC )
Newsgroups: comp.unix.shell
Subject: Blocking Control-C and Control-Z.
Date: 31 Aug 92 19:37:00 GMT
Distribution: comp.unix.shell
Organization: Concordia University, Montreal, Quebec

I have found that the only way to trap the break options in 
non ksh shells is to redirect them to some unused control 
sequences. When put in the .cshrc however, only the ^Z option
is redirected and the 'stty intr <something>' is ignored, unless
I later source the same file, which makes no sense whatsover.
'stty -isig' is fickle, it sometimes works and sometimes 
doesn't.  Does anyone have a working code that blocks both
the break and stop signals, which can be placed in .cshrc?
 
 
---
Dan.
From: kapela@prism.poly.edu (Theodore S. Kapela)
Newsgroups: comp.unix.shell
Subject: Re: How to empty a file
Date: 1 Sep 92 19:04:10 GMT
Organization: Polytechnic University, New York

In article <ahn.714982174@ac> ahn@ac.wfunet.wfu.edu (Dave Ahn) writes:
>
>Try 'touch logfile'

This will only leave an empty file if the file does not exist.  If the file
exists, it will only change the access and modification times.


-- 
..............................................................................
 Theodore S. Kapela				kapela@poly.edu
 Center for Applied Large-Scale Computing	
 Polytechnic University
Newsgroups: comp.unix.shell,comp.unix.questions,netcom.general
From: dlparker@dlpinc00.rn.com (David L. Parker)
Subject: Re: Need Script To Kill Process Using Substring Of Application Name
Organization: Automated Data Management Services
Date: Mon, 31 Aug 1992 09:56:04 GMT

In article <x6gnwvc.westes@netcom.com> westes@netcom.com (Will Estes) writes:
>Does anyone have a script that they could send to me that will take as
>its input some substring and then kill any process you own that has that
>substring in its application name?  So the script would do something

To kill a process named upsd:

pid=`/bin/ps -e | grep upsd | sed -e 's/^  *//' -e 's/ .*//'`
if [ "${pid}" != "" ]
then
	/bin/kill -9 ${pid}
fi
-- 
Dave Parker
Automated Data Management Services, Pleasant Hill, MO 64080-1331
(816) 987-5167/5218 voice/fax
From: messina@netcom.com (Tony Porczyk)
Newsgroups: comp.unix.shell
Subject: Re: script for eliminating newsarticle's headers
Date: 2 Sep 92 19:41:30 GMT
Distribution: usa
Organization: Messina Software

gan@sample-o.eng.ohio-state.edu (Yin Huang Gan) writes:

>I have been saving lots of articles of the different newsgroups. And I am too 
>lazy to figure out myself how to write a script for eliminating the headers
>of the article on the newsgroups (things like Path: , Article:, Keywords ...)
>with exceptions, Subject: and Date: perhaps. If it's not too much to ask, 
>could anyone please send me a copy of the script ? Thanks in advance. 

What newsreader do you use?


t.
Newsgroups: comp.unix.shell
From: aet@mullian.ee.mu.OZ.AU (bert thompson)
Subject: * WEEKLY SCHEDULE IN TCSH *
Organization: Computer Science, University of Melbourne, Australia
Date: Thu, 3 Sep 1992 10:34:19 GMT

hi!

could someone please tell me how to implement a weekly schedule
indicator in tcsh.

i want to be reminded whenever i have something to do on a particular day.
for example, if i have a 3pm lecture on wednesday, then i should get beeped:
*GO TO LECTURE*

anyone know how to do this? if not in shell, then in any available language.


cheers!

	bert.

--------------------------------------------------------------------------------
bert thompson	aet@munagin.ee.mu.oz.au.
SITEE		school of information technology and electrical engineering
		university of melbourne
--------------------------------------------------------------------------------
From: albani@cadlab.sublink.org (Lanfranco Albani)
Newsgroups: comp.unix.shell
Subject: Re: How can I rm a file with a '&' ????
Date: 2 Sep 92 11:57:15 GMT
Organization: CAD.LAB S.p.A., Bologna, Italia

hinz@picard.med.ge.com (David Hinz Mfg 4-6987) writes:
:Well, the following works on MY system (Sun 4.1.1):
:
:rm 'big&cow'
:
:as someone else had mentioned.  Perhaps NOGLOB has to be set, though.


Why not "rm big?cow" ?

Bye, Lanfranco

-- 
Lanfranco Albani - CAD.LAB s.p.a., v. Ronzani 7/29, Casalecchio, Italia
Email: (work:) albani@cadlab.sublink.org, (home:) bob@allan.sublink.org
Phone: (work:) ++39 (51) 6130360, (home:) ++39 (51) 727372; 
Fax: ++39 (51) 6130294 (work only), Fidonet: 2:332/407.1138 (home only).
Newsgroups: comp.unix.shell
From: Harald.Eikrem@delab.sintef.no
Subject: Re: Interactive csh: what is the comment char?
Organization: SINTEF DELAB, Trondheim, Norway.
Date: 2 Sep 92 23:33:20

! What is the comment character in an interactive csh? When I go
! 
! 	% # comment
! 
! is says
! 
! 	#: Command not found

Nope, it's not there.  Why?  Do you have an urge for producing interactive
commants? :)

The : command isn't usable either.  But if you redeclare it as

   alias :  if 0 0

then : becomes a do-nothing command.

  ~~harald E.
From: shuma-rl@phy.ncsu.edu (ROBERT L SHUMAKER)
Newsgroups: comp.unix.shell
Subject: Re: Help with directories!
Keywords: enough
Date: 29 Aug 92 00:38:48 GMT
Reply-To: shuma-rl@phy.ncsu.edu (ROBERT L SHUMAKER)
Followup-To: /dev/null
Distribution: usa
Organization: NC State University, Raleigh
Originator: shuma-rl@troy.phy.ncsu.edu


I hit "nn" today, like I do most days, and scan through my listed 
newsgroups.  Today, I find no less than half the posts to 
comp.unix.shell not talking about shell programming, but instead, 
people's posts being flamed OVER and OVER again on the same 
points, the same grounds, without change, without meaningful discussion.

Yes, luckily, I can now kill all the messages related to this.  But I 
must admit I think it's rather sad that a forum that was set up 
specifically for the purpose of discussing shell programming is
overrun by zealots who can only focus on non-shell issues.

Thanks for ruining my enjoyment of this group.  I truly appreciate it.

Bob
Newsgroups: comp.unix.shell,comp.unix.questions