HDTenEightyP/NetNews huggingface dataset:
From: hoepfner@usun01.UUCP (Andreas Hoepfner)
Newsgroups: comp.unix.shell
Subject: Re: cant delete file!
Keywords: funny filenames!
Date: 3 Sep 92 08:14:08 GMT
Organization: Nixdorf Computer AG, Paderborn, Germany

In <mcook.714928300@fendahl.dev.cdx.mot.com> mcook@fendahl.dev.cdx.mot.com (Michael Cook) writes:

>vidya-v@acsu.buffalo.edu (vidyaranya) writes:

>>-rw-r--r--  1 vidya-v         0 Aug 24 12:02 A??LN???N???-@??-

>>How do I delet it?

On some Systems there is a command 'clri' (clear inode) which
deletes the inode directly. Read the manual....

On the other hand You can use a HEX-EDITOR to change the funny
filename (like HexView).

Andreas


 +-----------------------------------------------------------------------+
 |                     Andreas Hoepfner                                  |
 |                                                                       |
 |     paper mail:                            e-mail:                    |
 | Siemens Nixdorf Informations                                          |
 |         Systeme                      USA:  hoepfner.kd@sni-usa.com    |
 | Abt. PU 2221                         !USA: hoepfner.kd@sni.de         |
 | Heinz Nixdorf Ring                                                    |
 | D-4790 Paderborn                                                      |
 | tel.: (+49) 5251 8-27479                                              |
 +-----------------------------------------------------------------------+

Newsgroups: comp.unix.shell
From: rsalz@osf.org (Rich Salz)
Subject: Re: Shell Scripts vs. C programs
Organization: Open Software Foundation
Date: Wed, 2 Sep 1992 14:22:12 GMT

In <FRIEDMAN.92Sep2045423@nutrimat.gnu.ai.mit.edu> friedman@gnu.ai.mit.edu (Noah Friedman) writes:
>fork is expensive and it's not going to get better any time soon ...
> and exec is even worse
I am totally dismayed and depressed by this attitude:  "The OS isn't fast
enough so I will glom all the features I might ever need into my program."
Is it not totally obvious to you that this mindset is BROKEN!?

Looking at the poster's domain, I guess I shouldn't be surprised.
However, I fear for the FSF OS.
	/r$
Newsgroups: comp.unix.shell
From: rsalz@osf.org (Rich Salz)
Subject: Re: tcsh: How to disable printing motd w/o disabling mail check?
Organization: Open Software Foundation
Date: Wed, 26 Aug 1992 14:34:56 GMT

In <17dnbeINNq2f@agate.berkeley.edu> forest@soda.berkeley.edu (Forest Edward Wilkinson) writes:
>I'm using tcsh, and would like to disable the printing of /etc/motd
>at login, without getting rid of the "You have {new} mail" messages.
>
	cmp -s /etc/motd $HOME/.hushlogin
	if ( $status ) tee $HOME/.hushlogin </etc/motd
From: rouben@math13.math.umbc.edu (Rouben Rostamian)
Newsgroups: comp.unix.shell
Subject: Re: Help with directories!
Date: 26 Aug 92 14:50:29 GMT
Organization: University of Maryland Baltimore Campus

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.
>>
>>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
>question, and let's get on with our lives ...

I agree.  Cut the religious arguments and offer solutions.  Here's how
you do it in awk:

Create a file called convert.awk, containing:

{	for (i=2; i<=10; i++) {
		n = 2*n
		if ( substr($0,i,1) != "-" )
			n++;
	}
	printf ("%o\n", n)
}

Then the apply the command:
echo -rwxr-xr-x | awk -f convert.awk
to get 755.

If you have nawk, you can write the script a bit more elegantly as:

{	for (i=2; i<=10; i++)
		n = 2*n + ( substr($0,i,1) != "-" ? 1 : 0 )
	printf ("%o\n", n)
}

Usage remains the same.  Handling suid bits, etc., is left as excercise.
That's all, folks!

--
Rouben Rostamian
Newsgroups: comp.unix.shell
From: digdon@ug.cs.dal.ca (Mike Digdon)
Subject: Re: Help with directories!
Organization: Math, Stats & CS, Dalhousie University, Halifax, NS, Canada
Date: Tue, 25 Aug 1992 15:55:17 GMT

In article <1992Aug25.142330.13023@news.eng.convex.com> tchrist@convex.COM (Tom Christiansen) writes:
>From the keyboard of ash@ulysses.mr.ams.com (Alan Harder):
>:In article <1992Aug24.195943.2766@prl.dec.com> boyd@prl.dec.com (Boyd Roberts) 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.
>:
>:> So for just how many minutes have you been reading this group for?
>:
>: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.
>
>But we discussed it ad nauseum just five days ago!!
>
>--tom
>-- 
>    Tom Christiansen      tchrist@convex.com      convex!tchrist
>
>    "* Unix is a footnote of AT&T Bell Laboratories."
>                             --Barry Shein

However, some systems don't have the space to keep reems of messages on the
system, and he may have first decided to read this group right after the "old"
ones were purged.. I know this is the case with some of the newsgroups here
at Dal..

-- 
	     Mike Digdon - Vice Prez DSCSS - Dalhousie University
		     digdon@ug.cs.dal.ca  -- Halifax, NS
		 - Real programmers never work nine to five -
Xref: sparky comp.unix.shell:3704 comp.unix.questions:10551
From: montnaro@ausable.crd.ge.com (Skip Montanaro)
Newsgroups: comp.unix.shell,comp.unix.questions,netcom.general
Subject: Re: Need Script To Kill Process Using Substring Of Application Name
Date: 31 Aug 92 03:16:40 GMT
Reply-To: montanaro@crd.ge.com (Skip Montanaro)
Organization: GE Corporate Research & Development, Schenectady, NY

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?

Here's a script that might fit the bill:

    #!/bin/sh

    ps -auxww | egrep $1 | grep -v egrep | awk '{print $2}' | xargs kill

Call it slay?

Of course, on a SysV machine it will have to be "ps -efl" and "{print $3}".

--
Skip (montanaro@crd.ge.com)
Newsgroups: comp.unix.shell
From: W10075@maccvm.corp.mot.com (Stephen Weet)
Subject: Re: Distinguish between numeric & nonnumeric char strings in shell ?
Organization: Motorola
Date: 4 Sep 1992 10:40:12 CDT

------------------------- Original Article -------------------------
Path:
schbbs!mothost!ftpbox!uunet!wupost!sdd.hp.com!hplabs!ucbvax!CSGRAD.CS.VT.EDU!ram
akris
From: ramakris@CSGRAD.CS.VT.EDU (S.Ramakrishnan)
Newsgroups: comp.unix.shell
Subject: Distinguish between numeric & nonnumeric char strings in shell ?
Date: 4 Sep 92 07:02:38 GMT
------------------------- Original Article -------------------------
Path:
schbbs!mothost!ftpbox!uunet!wupost!sdd.hp.com!hplabs!ucbvax!CSGRAD.CS.VT.EDU!ram
akris
From: ramakris@CSGRAD.CS.VT.EDU (S.Ramakrishnan)
Newsgroups: comp.unix.shell
Subject: Distinguish between numeric & nonnumeric char strings in shell ?
Date: 4 Sep 92 07:02:38 GMT
Organization: VPI&SU Computer Science Department, Blacksburg, VA


 How does one distinguish between a number and a nonnumeric
 character using shelltools (sh/csh, awk, sed, expr, etc) ?
 I am trying to validate the IP address typed in by the user.
 I isolate the four components and check each one to see if lies
 within the legal range (0..255). In the event the user types, say,
 tom.jack.joe.jim, I want to be able to flag an error. However the
 IF statement, marked (+) in the fragment below, fails even if a 4
 component string such as "tom.jack.joe.jim"  is entered.
 Any suggestions ?

 Encl:
	#!/bin/sh
        ...
	while test "$ip" = ""
	do
          echo "    IP Address = "
	  read ip
          if [ "$ip" != "" ]
	  then
              cnt=`echo $ip | awk -F'.' '{ print NF }'`
              one=`echo $ip | awk -F'.' '{ print $1}'`
              two=`echo $ip | awk -F'.' '{ print $2}'`
              thr=`echo $ip | awk -F'.' '{ print $3}'`
              fou=`echo $ip | awk -F'.' '{ print $4}'`
#(+)
              if [ $cnt -ne 4 -o $one -gt 255 -o $two -gt 255 -o $thr -gt 255 -o
$fou -gt 255 ]
              then
	        echo ""
                echo "*** Invalid IP Address Format: Please Retype"
	        echo ""
	        ip=""
              fi
	  fi
        done
	...

---
YOU MIGHT TRY SOMETHING LIKE THIS


#!/BIN/SH
OLDIFS=$IFS
IFS='.'
ECHO "PLEASE ENTER AN IP NO. : \C"
READ PART1 PART2 PART3 PART4
IFS=$OLDIFS

FOR PART IN $PART1 $PART2 $PART3 $PART4
DO
    RES=`EXPR $I + 0 2>/DEV/NULL`
    [ "$RES" -LE 0 -O "$RES" -GT 255 ] && {
           ECHO "ERROR IN I.P NUMBER "
           EXIT 1
    }
DONE


REGARDS
STEVE WEET




Newsgroups: comp.unix.shell
From: ericd@synoptics.com (Eric Davis)
Subject: Re: Help with directories!
Reply-To: ericd@synoptics.com
Organization: Synoptics Inc. Santa Clara, California.
Date: Wed, 26 Aug 1992 18:08:59 GMT

In article 87094@netnews.upenn.edu, chip@midnight.seas.upenn.edu (Charles H. Buchholtz) writes:
>
>I have explained to them all that when I say, "See if you can get the
>answer from comp.foo.bar", I mean
>
>	1) Check for an FAQ in news.answers
>	2) Search backwards for two months, 500 articles, or as much
>	   as we still have online (whichever is shorter)
>	3) If this looks like the right place (from step 2), post the
>	   question
>
>If they find the answer in step 1 or 2, I get the answer sooner
>(usually).  Otherwise, it doesn't slow us down significantly.  It's
>certainly *lazier* to just post without searching first, but I don't
>think it's significantly *faster*.

Some sites do not keep that many articles online....

>
>By the way, as I recall from the discussion earlier this month in this
>news group, there are three approaches to getting octal permissions:
>C, perl, and awk.  No one reported an easy solution, such as an option
>to ls.

I looked for one, but did not find one. If you know of one please offer it up!

Thanks
Eric
From: regli@bedlam.cme.nist.gov (William Regli)
Newsgroups: comp.unix.shell
Subject: stdin Error
Date: 27 Aug 92 18:27:54 GMT
Distribution: comp
Organization: National Institute for Standards and Technology


Hello all--

I'm attempting to run a csh shell program in the background and am
being faced with the following error when the program starts:


       Warning: Cannot freopen /dev/tty to stdin


This is a program that I have had working before and suddenly it
cannot find stdin.  Every time I redirect output with "cat xxx > yyy"
or "ls >> zzz" in the program it does not go to the files xxx and yyy.
They end up empty and the output goes elsewhere.  I've had ethe
program print out `tty` and it claims to not be running on a terminal.

Is ther any way I can fool it into think it is on a terminal?  I know
I had this working before---what could I have possibly changed?

Thanks in advance!

b
================ 
William C. Regli                              
United States Department of Commerce          	
National Institute for Standards and Technology 
Factory Automation Systems Division, Engineering Design Laboratory
Gaithersburgh, MD 20899
Electronic: regli@cme.nist.gov  Vocal: (301)-975-3978
Newsgroups: comp.unix.shell
From: jsbazine@garfield.waterloo.edu (Steve Bazinet)
Subject: Re: mail script
Reply-To: jsbazine@garfield.waterloo.edu
Organization: Department of Computing Services, University of Waterloo
Date: Wed, 26 Aug 1992 18:08:20 GMT

In article 3495@babcock.cerc.wvu.wvnet.edu, abmg@cathedral.cerc.wvu.wvnet.edu (Aliasghar Babadi) writes:
>
>
>Hi,
>        I have a file of email addresses. I want to send the same mail
>to each address in the file, separately (one address in the mail header
>for each one). Is there any script that I can use for that. Thanks.


Ok if you file of email addresses looks like the following it pretty easy.

userid1@whatever
userid2
userid3@whaterver.whaterver.edu

this will work as long as you have one userid per line.

1) first write up you mail message using your favorite editor

2) at the prompt tpye the following:
    [%] foreach i ( `cat useridfilename` )       /*notice the back quotes around cat*/
      ? mail -s "Your Subject" $i < youmailfile
      ? end

That's it.  You could also put the above line is to a script file.

Steve
---
===============================================================================
=                               Steve Bazinet                                 =
=         Department of Computing Services - University of Waterloo           =
=    jsbazine@garfield.uwaterloo.ca  (or)  jsbazine@watserv1.uwaterloo.ca     =
Newsgroups: comp.unix.shell
From: plobo@dvlseq.us.oracle.com (Patrick Lobo)
Subject: Re: How to empty a file
Organization: Oracle World HQ, Redwood Shores, California
Date: Sat, 29 Aug 1992 01:49:25 GMT
X-Disclaimer: This message was written by an unauthenticated user
              at Oracle Corporation.  The opinions expressed are those
              of the user and not necessarily those of Oracle.

In article <ahn.714982174@ac> ahn@ac.wfunet.wfu.edu (Dave Ahn) writes:
>dattier@ddsw1.mcs.com (David W. Tamkin) writes:
>
>>digdon@ug.cs.dal.ca (Mike Digdon) wrote in <BtLLps.But@cs.dal.ca>:
>
>>| You could also do:
>>| 
>>| 	echo > logfile
>
>>That will not leave an empty file; the file will contain one newline and
>>nothing else, but it won't be empty.
>
>Try 'touch logfile'
>-- 
>Dave Ahn


Touch won't work in this case, because the logfile already exists and 
is of finite size.  The user wants to truncate a pre-existing file to zero
length.

pl
From: gsa@alcor.concordia.ca ( CON U GRADUATE STUDENTS' ASSOC )
Newsgroups: comp.unix.shell
Subject: Calling a function from a case loop.
Date: 23 Aug 92 16:46:22 GMT
Distribution: comp.unix.shell
Organization: Concordia University, Montreal, Quebec

Has anyhone tried calling a function from a case condition?
This one doesn't seem to work:
 
read selection
case $selection in
 
1)
call_some_funtion() ;;
 
esac
done
exit 0
                      
call_some_funtion()
{
echo "Hello World"
}
 
-----
Dan.
From: messina@netcom.com (Tony Porczyk)
Newsgroups: comp.unix.shell
Subject: Re: Help with directories!
Date: 28 Aug 92 03:28:03 GMT
Followup-To: alt.flame
Organization: Messina Software


john@physiol.su.OZ.AU (John Mackin) replies to sandman@cray.csc.ncsu.edu:

> In article <1992Aug25.235402.13164@ncsu.edu>,
>         sandman@cray.csc.ncsu.edu (Mr Sandman) writes:
> > boyd@prl.dec.com (Boyd Roberts) writes:
> > : [Boyd's response to Eric Davis]
> > [...]
> > If you don't like a post then skip it.
>
> Hey, gee, isn't this nice.  This dipstick turkey thinks he's the
> moderator of comp.unix.shell.  And wow, you know, he can't even
> manage to stand up and be counted under his _real name_!!  `Mr
> Sandman'?  What kind of crap is that?

This is fascinating.  Now may I ask why the hell are you calling
another poster a "dipstick turkey" even though he has not attacked you
or said anything insulting to anyone?  What kind of asshole do you
have to be to do that?  Also, since you preach to him later on the
time you have apparantly spent on USENET, your cretinic question about
a use of a handle is indeed interesting.

> Look, buddy, if you are going to presume to tell people how to behave
> on Usenet -- people, for that matter, who were using Usenet while you
> were probably not even thought of yet -- the least you can do is use a
> real name and a real address.

And what the f***, may I ask, do you need his real name for?  Are you
going to pay him a visit?  What is this, some kind of a net police,
registering names and addresses?  Can't you talk to someone without
seeing his birth certificate?

> Oddly enough, the Domain Name System doesn't know "cray.csc.ncsu.edu".
> Now why doesn't that surprise me?

Oddly enough, the Domain Name System doesn't know "john@physiol.su.OZ.AU".
Is there some special meaning in this?  What the hell is your problem?

> If you are too afraid to admit to your identity, and too afraid
> to supply an address that works, then KEEP YOUR IDIOT MOUTH SHUT.

Read above.  And tell me something, because I am trying to understand
your pathological outburst of hate toward a poster that did not even
address his rather mild article toward you:  what is troubling you?


t.
From: JRowe@exua.exeter.ac.uk (John Rowe)
Newsgroups: comp.unix.shell
Subject: Re: Help with directories!
Date: 2 Sep 92 10:37:14 GMT
Organization: Computer Unit. - University of Exeter. UK
In-reply-to: ericd@synoptics.com's message of 24 Aug 92 17:56:14 GMT


	Sixteen followups complaining that the subject was discussed
five days ago and no one stoops to post the answer. Is this a new
depth for the net?

And no, I wasn't reading five days ago. 

John.
Newsgroups: comp.unix.shell
From: Harald.Eikrem@delab.sintef.no
Subject: Re: How to make tcsh the login shell w/0 bothering operator? !FAQ
Organization: SINTEF DELAB, Trondheim, Norway.
	<BtAq1o.I2L@news.cso.uiuc.edu>
Date: 26 Aug 92 00:32:00

! :)   Just out of curiosity, why not get your sysadmin to put the appropriate
! :)magic in /etc/shells?  It's what, 20 seconds of work?
! 
! I know at uiuc, most (read all :) of the admins like to not have anything
! like that in a joe-user's directory, nor do they simply want to copy a
! compiled program, meaning they have to compile it themself. However,
! they don't want to be bothered with finding the source code. Usually
! here a person (in this case) would have to find the source code, set it
! up in /tmp, and ask *very* nicely.  :)
! -- 
!         Josh Laff              #     #      

If it's that troublesome, chsh to (or ask for) /bin/sh as your login
shell, because it is definitely going to be fastest one to start up of
them all.  Do set up a minimalistic $PATH, check for and exec your
favourite shell binary from within your .profile

It is recommendable to create a symbolic link to the shell executable --
the symlink name should start with a dash (-) and be placed in one of your
$PATH dirs -- then exec the symlink in order for the shell to process
its proper login files.

Simple as that....

  ~~harald E.
Newsgroups: comp.unix.shell
From: Harald.Eikrem@delab.sintef.no
Subject: Re: Distinguish between numeric & nonnumeric char strings in shell ?
Organization: SINTEF DELAB, Trondheim, Norway.
Date: 4 Sep 92 19:13:37

!  How does one distinguish between a number and a nonnumeric
!  character using shelltools (sh/csh, awk, sed, expr, etc) ? 

In a /bin/sh script, to test if a parameter (or a variable) truly is
an integer number, you'd have to find out if that shell (/bin/sh)
groks character class inversion, like:

	[!0-9]   matches any char except digits

and if it does, you can do something like:

	while :; do
	  case $arg in
	    *[!0-9]*)
		echo >&2 "Argument is non-numeric"
		echo -n >&2 "Reenter: "
		read arg
		;;
	    *)	break
	  esac
	done

If the shell does not understand character class inversion, you may
still be able to perform a test like this without applying external
progs (sed/awk/expr/...), but certainly it will be more cumbersome,
like e.g.:

	case $arg in
	  *[^A-/:-~]*)
		echo >&2 "Argument is non-numeric"
		......

where ^A denotes a real control-A character in the script.
Or if you can't get that to work, here comes a last resort:

	case $arg in
	  [0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9] |\
	  [0-9][0-9][0-9][0-9][0-9] | [0-9][0-9][0-9][0-9][0-9][0-9] |\
		......
		......

You get the picture.


!  I am trying to validate the IP address typed in by the user. 
!  I isolate the four components and check each one to see if lies 
!  within the legal range (0..255). In the event the user types, say, 
!  tom.jack.joe.jim, I want to be able to flag an error. However the 
!  IF statement, marked (+) in the fragment below, fails even if a 4 
!  component string such as "tom.jack.joe.jim"  is entered. 
!  Any suggestions ?

Supposing you actually want the script to decide whether it's a simple
hostname, a domainified hostname or an IP (decimal) numeric address,
I'd say that a test like

	case $address in
	  *.*.*.*.*)			# domainified hostname
		;;
	  [1-9]*.[0-9]*.[0-9]*.[0-9]*)	# IP numeric address
		;;
	  *.*)				# domainified hostname
		;;
	  *)				# simple hostname
	esac

would suffice, because the likelihood of ever finding a true domain-
name that would match the 2.nd case is none.

But of course, if you dont trust the users to know how to enter a
dotted 4-digit IP address, it'll take more effort to get it checked.
To check each of the IP address elements, do something like:

	saved_args=$@		# only if $@ is to be used later on

	_IFS=".$IFS"
	set -- $address
	IFS="$_IFS"
	if [ $1 -lt 1 -o $1 -gt 223 -o $2 -gt 254 -o \
	     $3 -gt 254 -o $4 -lt 1 -o $4 -gt 254	]; then
		echo >&2 "Argument is not a legal IP numeric address"
		......
		......
	fi

	set -- $saved_args	# if need be


I'm not going to speak about sed/awk/<whatever> solutions.

  ~~harald E.
From: chip@midnight.seas.upenn.edu (Charles H. Buchholtz)
Newsgroups: comp.unix.shell
Subject: Re: Help with directories!
Date: 26 Aug 92 17:36:03 GMT
Organization: University of Pennsylvania

In article <BtLLGI.BtJ@cs.dal.ca> digdon@ug.cs.dal.ca (Mike Digdon) writes:
>>
>>The point is that you can't volunteer everyone to act as the archive master
>>for the group, sending threads to hapless new posters.  What is so horribly
>>bad about reading a group for a few weeks before you post?
>>
>>--Dave
>
>The answer to the above question is very simple.. what if you need the
>information NOW, and not a few weeks from now?  [...] Now, netiquette
>says "Don't post until you are familiar.."  The boss says, "Find the
>answer before lunch or you will be reading net.jobs.." I think you
>would post before you were supposed to..

Well, I *am* a boss, who frequently tells my staff to find out the
answer by posting to the net.  Frequently, this involves posting to
news groups that they have never even heard of, much less have read.

I have explained to them all that when I say, "See if you can get the
answer from comp.foo.bar", I mean

	1) Check for an FAQ in news.answers
	2) Search backwards for two months, 500 articles, or as much
	   as we still have online (whichever is shorter)
	3) If this looks like the right place (from step 2), post the
	   question

If they find the answer in step 1 or 2, I get the answer sooner
(usually).  Otherwise, it doesn't slow us down significantly.  It's
certainly *lazier* to just post without searching first, but I don't
think it's significantly *faster*.

By the way, as I recall from the discussion earlier this month in this
news group, there are three approaches to getting octal permissions:
C, perl, and awk.  No one reported an easy solution, such as an option
to ls.

Charles H. Buchholtz                           chip@seas.upenn.edu
Systems Programmer                             (215) 898-2491
School of Engineering and Applied Science      200 S. 33rd St, rm 154
University of Pennsylvania                     Philadelphia, PA 19104
Newsgroups: comp.unix.shell,comp.unix.questions