HDTenEightyP/NetNews huggingface dataset:
From: ckd@eff.org (Christopher Davis)
Subject: Re: Octal chmod status
Organization: Electronic Frontier Foundation Tech Central
	<1r!n6yd.messina@netcom.com>
	<1992Aug19.143059.17010@news.eng.convex.com>
Date: Wed, 19 Aug 1992 22:04:11 GMT

Tom> == Tom Christiansen <Tom Christiansen <tchrist@convex.COM>> 

 Tom> The bruhaha stems from having to install a hundred binaries on a
 Tom> hundred systems spanning a dozen different architectures.
 Tom> Programs that aren't self-contained are a major hassle.

Think about this one for a moment, folks.

In these days of multivendor distributed environments, it's not uncommon
for your home directory to be mounted on VAXen, ULTRIX-running MIPSel,
IBM RTs and RS6000s, NeXTs, Sun3s, Sun4s, Encore Multimaxen, and HP PAs.

I recognized this fact long ago, and set up my "personal" executables in
a two-pronged form:

binary executables are in ~/bin.ARCH/*, where ARCH is usually handled by
tcsh (which sets $HOSTTYPE).  Right now all I have is ~/bin.sun4, since
I stopped cross-mounting to the NeXT, but that's more an accident of
acquisition than anything preplanned.

non-binary executables, primarily perl scripts, are in ~/notbin, since
they're "not binary". :)  I can tar this up and haul it over to a new
account without worrying about shared library revisions, binary
compatibility, bytesexual perversions, or the thorny issues of differing
/bin/sh implementations, as long as the other site has perl.

(If it doesn't, bang goes a copy in ~/bin.ARCH until the system admins
can compile it ;-)

If I had an account on, say, MIT Athena, I'd have perl available across
the board, and could keep one, not three, copies of my programs...
--
Christopher Davis * ckd@eff.org * System Administrator, EFF * +1 617 864 0665
            ``Ed Gruberman, you fail to grasp Ti Kwan Leep.
            Approach me that you might see.'' -- The Master
From: hendefd@woof.duc.auburn.edu (Frank Henderson)
Newsgroups: comp.unix.shell
Subject: sending mail from shell
Date: 21 Aug 92 15:41:05 GMT
Reply-To: hendefd@woof.duc.auburn.edu
Organization: Sun Microsystems, Inc.

I need a shell script (csh or sh) to send me mail after completion.
I tried /usr/lib/sendmail -bm -fperson -t me and then echo'ing a 
message but this requires an EOF or CTRL-d which I don't know how
to do from a shell.  Could someone tell me how to do this or suggest
a better way.

Thanks for the help.
Email to address below and I'll summarize.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Frank Henderson              \     /      E-mail: hendefd@tech.duc.auburn.edu
Network Technical Support     \   /       phone : (205) 844-4512
                           ----/_\----
               x--------------( . )--------------x    CF-18 Hornet
                    x|x   | |_|\_/|_| |   x|x        by Paul Tomblin 
                     x    x           x    x       pt@geovision.gvc.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: bradley@milton.u.washington.edu (Scott Bradley)
Newsgroups: comp.unix.shell
Subject: Re: changing password in a sh script
Date: 16 Aug 92 09:04:39 GMT
Organization: University of Washington

adunham@arnauds.cs.uno.edu (Andrea M Dunham) writes:

>Hi Folks,
>  Will someone please post how to change/set passwords after using Sun's  
>add_user script.  It doesn't seem to work to (from the script) just use
>	==  script stuff ==
>	passwd <uname>
>	<password>
>	<password>
>	==  other script stuff ==

>Any help is much appreciated.
>		* AndREa *
>		adunham@cs.uno.edu
passwd requires interaction with user and can't be scripted short of
using something like 'expect,' which comes with a sample script to
do exactly what you want.  (see comp.unix.questions FAQ)
Newsgroups: comp.unix.shell
From: cld@gmhgate.gmh.edu (Charles D'Englere)
Subject: csh commands
Summary: I need a good routine for reading in a file
Keywords: commands csh read file
Organization: Grady Memorial Hospital
Date: Thu, 13 Aug 1992 05:33:43 GMT

I have been working on a project that requires that I use the csh shell
to work with the exsiting program. I have a few questions: 1 - Is there
a way to parse the command line using either pipes '|' or newlines - 
example

ncs% cat $homedir/$1 |

If I do this with a RETURN I get a "Invaild null command."

2 - I need a routine to replace the following Bourne shell routine

cat $homedir/$1 | while read EADDR IPADDR SW_VER

to  a csh shell equivalent.

cld 
----
The world is like a big pie, everyone wants a piece of it ...
From: kimcm@login.dkuug.dk (Kim Chr. Madsen)
Newsgroups: comp.unix.shell
Subject: Re: How can I rm a file with a '&' ????
Date: 23 Aug 92 14:54:55 GMT

boyd@prl.dec.com (Boyd Roberts) writes:

>No, no.  A file with an & requires removal with:
>    rm 'big&cow' &

no, no , no

It needs *very* special treatment:

	echo "main(){unlink("big&cow");}" | /lib/c0 | /lib/c1 > /tmp/bull\&shit.s
	as /tmp/bull\&shit.s
	ld /lib/ctt0.o /tmp/bull\&shit.o -lc
	a.out
	rm '/tmp/bull\&shit*' &

 
 Insert (-; as needed....

 What a shame as(1) and ld(1) can't read from stdin (at least not all versions)...
Newsgroups: comp.unix.shell
From: jerry@incc.com (Jerry Rocteur)
Newsgroups: comp.unix.shell
Subject: Re: Octal chmod status
Summary: skills
Date: 19 Aug 92 20:56:14 GMT
Organization: InCC.com Perwez Belgium

In article <1r!n6yd.messina@netcom.com>, messina@netcom.com (Tony Porczyk) writes:
> Tom Christiansen <tchrist@convex.COM> responds to Marc Unangst:
> 
> >Big deal.  That infinitesimal time difference is surely not
> >worth all the hassle of writing a C program for each and every little
> 
> Even though I agree that the perl solution was fine (by being so
> small), but I do not understand the bruhaha about the "hassle" of
> writing a C program for small tasks.  It is often much simpler and
> *faster* to write the C code than to implement other solutions.  At
> least it is much more *readable* than the aformentioned perl script... 
> 
> t.
Does this not depend on your skills ?????

If Mr Christiansen is not familiar with C then maybe his choice is
something else !!!

You use your skills as best as you can, as long as you know yours and
your tools limitations, but C does not have many :-)


-- 
 __^__                                                              __^__
( ___ )------------------------------------------------------------( ___ )
 | / | Jerry Rocteur                         Email: jerry@InCC.COM  | \ |
 | / | Independent Computer Consultants  Division de DELRA s.p.r.l  | \ |
 |___|                 Perwez Belgique Europe                       |___|
(_____)------------------------------------------------------------(_____)
   ^                                                                  ^
Newsgroups: comp.unix.shell
From: roy@zooks.eng.mcmaster.ca (Roy Underhill)
Subject: Re: unwinding $variables in csh
Summary: Use more than lines of code
Keywords: resolve, unwind $variables, csh
Organization: Dept. of Mech. Eng., McMaster University
Date: Wed, 12 Aug 1992 16:42:13 GMT

In article <1992Aug9.194325.1476@sol.UVic.CA> stilley@csr.UVic.CA (Scott  Tilley) writes:
>What is the easiest way to completely resolve variables in csh? I have
>several variables that are made up of other $variables. I do not
>want them expanded until the end of the script, so I use
>
>	set var1 = '$HOME'
>	set var2 = '$var1/dir'
>
>for example. At the end of the script I need to propagate var2 to the
>environment, such as
>
>	setenv DIR $var2
>
>but this produces "$DIR = $HOME/dir", i.e., $HOME does not
>get expanded. How can I get csh to fully expand all variables
>in one shot?
>
>	..Scott

This looks like one of those times when cleverness does not pay off.
Rather than do something really neat that will magically convert it
all at once, it is sometimes much easier to use more than one line of
code.  Alternatively just do your compounding all in the last line.
eg

set var1 = $HOME
set var2 = /dir
setenv DIR $var1$var2

This is not quite what you asked for, but it does do the job. 

Good Luck,


Roy

-- 
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
  Roy Underhill,  (416) 525-9140 x4395   roy@zooks.eng.mcmaster.ca 
  Department of Mechanical Engineering,  McMaster University, 
  Hamilton,  Ontario,  Canada            L8S 4L7
From: hsc@sybase.com (Howard Cohen)
Newsgroups: comp.unix.shell
Subject: Portability of ASCII across Unixes (was Re: How do I get .login to pause ?)
Summary: How portable is ASCII across modern Unixes?
Date: 21 Aug 92 00:28:14 GMT
Organization: Sybase, Inc.

In article <Bt4qL6.JpA@root.co.uk> gwc@root.co.uk (Geoff Clare) writes:
>In <22412@sybase.sybase.com> hsc@sybase.com (Howard Cohen) writes:
>|In article <Bss2xD.GKE@root.co.uk> gwc@root.co.uk (Geoff Clare) writes:
>|>If it comes to that, '\012' is not portable either.  Use:
>
>|What?!?  What Unix machines won't this work on?
>
>Any machine that doesn't have ASCII as its native character set.
     ^^^^^^^

Any *Unix* machine, yes.  So name one that doesn't support ASCII. We're not 
talking in the hypothetical here. I can't think of one, and Sybase supports 
almost 30 different vendor's platforms.  We even have a Sun JLE port 
(japanese language environment -- supports multi-byte characters), and it 
works fine there too.  

I asked one of our front-end-tools managers if there were any Unix machines
that didn't understand ASCII. He said that he didn't think there were any.
JLE in particular is backwardly compatible with ASCII.  If the high bit is
on for a byte, its assumed to be a two-byte character.  Otherwise, it's
assumed to be ASCII.

Portability is an important issue to me, and if ASCII really isn't portable
across modern unixes, then I want to know.

We may be heading toward a time when ASCII becomes obsolete in favor of
a larger, international character set.  I've heard of something along those
lines.  If and when that becomes a standard that Unix machines embrace, then 
there may be a portability problem.  If thats what you were referring to,
then I'd agree with you.

	Howard
-------------------------------------------------------------------------------
  Howard "I wood if I could" Cohen
  hsc@sybase.com  {pacbell,pyramid,sun,{uunet,ucbvax}!mtxinu}!sybase!hsc
  Sybase, Inc.    6475 Christie Avenue, Emeryville, CA 94608, 510-596-3406 
Newsgroups: comp.unix.shell
From: adunham@arnauds.cs.uno.edu (Andrea M Dunham)
Subject: changing password in a sh script
Organization: University of New Orleans
Date: Fri, 14 Aug 1992 17:11:23 GMT

Hi Folks,
  Will someone please post how to change/set passwords after using Sun's  
add_user script.  It doesn't seem to work to (from the script) just use
	==  script stuff ==
	passwd <uname>
	<password>
	<password>
	==  other script stuff ==

Any help is much appreciated.
		* AndREa *
		adunham@cs.uno.edu
Newsgroups: comp.unix.shell
From: bduncan@ve3ied.UUCP (Bill Duncan)
Subject: Re: searching for 1st occurrence
Organization: TFMCS
Date: Fri, 14 Aug 1992 01:21:56 GMT

In article <15m8aqINN6ci@seven-up.East.Sun.COM> ltaylor@blinky.East.Sun.COM (Laura Taylor) writes:
>Inside a shellscript, I would like to search for only the
>first occurrence of a particular string, or in otherwords,
>just one occurrence of the same string so I can set it to
>a variable.
>
>For example, say in file called systems, there is a list of
>all the system architectures something like...
>
>SS2
>SS1
>SS2
>4/75
>
>I'd like to use say grep such that when I search for SS2, it
>only grabs one occurrence of SS2, and does not spit out SS2 twice.
>
>Anyone got any hints?
>
>Thanks,
>
>/laura 

This is the kind of thing awk's associative arrays make easy.
I'll show you an abridged version of what I use for finding out *just*
the last time everyone has logged in:

last | awk '
{
    if (!($1 in SeenIt)) {
        SeenIt[ $1 ] = 1 # just store anything here, eg. line itself etc.
        print
    }
}'

You can of store other data in the associative arrays if you need to.
Since we don't need to here, I just store a "1" as a placeholder.  In
fact I think an empty string will work just as well.

Hope this helps.
Regards,

Bill Duncan (bduncan@ve3ied.UUCP)

Newsgroups: comp.unix.shell
From: rtbunker@tan.Princeton.EDU (Ross T. Bunker)
Subject: Re: csh echo newlines
Originator: news@nimaster
Organization: Princeton University
Distribution: na
Date: Sat, 22 Aug 1992 19:34:00 GMT

In article <17514@autodesk.COM> dansmith@Autodesk.COM (Daniel Smith) writes:
>In <1992Aug19.041937.14932@novell.com> tporczyk@novell.com (Tony Porczyk) writes:
>
>> wb8foz@skybridge.SCL.CWRU.Edu (David Lesher) writes:
>
>> >How do I get a csh echo statement to output a newline?
>> >All the book examples talk about supressing them. I want one!
>
>> echo ""
>
>	And if you want a lot of them, try:
>
>	echo 'line 1=line 2=line 3' | tr '=' '\015'
>
>				Daniel

i do it this way in sh
 ( echo "blah"; echo "blah"; echo "blah" ) | whatever cmd.

very useful for piping commands to ed

cheers

-- 
------------------------------------------------------------------------------
:)ross                            | I don't have to take this abuse from you -- 
Internet - rtbunker@princeton.edu | I've got hundreds of people waiting to abuse
Bitnet   - rtbunker@pucc.bitnet   | me.  --Bill Murray, "Ghostbusters"
From: tchrist@convex.COM (Tom Christiansen)
Newsgroups: comp.unix.shell
Subject: Re: Octal chmod status
Date: 20 Aug 92 03:03:05 GMT
Article-I.D.: news.1992Aug20.030305.15096
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: Convex Computer Corporation, Colorado Springs, CO
Originator: tchrist@pixel.convex.com
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of jerry@incc.com (Jerry Rocteur):
:In article <1r!n6yd.messina@netcom.com>, messina@netcom.com (Tony Porczyk) writes:
:> Tom Christiansen <tchrist@convex.COM> responds to Marc Unangst:
:> 
:> >Big deal.  That infinitesimal time difference is surely not
:> >worth all the hassle of writing a C program for each and every little
:> 
:> Even though I agree that the perl solution was fine (by being so
:> small), but I do not understand the bruhaha about the "hassle" of
:> writing a C program for small tasks.  It is often much simpler and
:> *faster* to write the C code than to implement other solutions.  At
:> least it is much more *readable* than the aformentioned perl script... 
:> 
:> t.
:Does this not depend on your skills ?????

Of course: if you knew nothing but assembly language, then you'd write
code in nothing but that, and I would write hundreds of times more
programs than you, solving hundreds of times more problems.  Knowing a
variety of tongues and the constraints of the problem, you can select the
best tool for the task at hand, and go on to write another program.  

:If Mr Christiansen is not familiar with C then maybe his choice is
:something else !!!

Please don't vous me -- I hate "Mr.", as it implies a difference of
station I am not comfortable with.  My name is Tom.  Please use it.

I assure you, Jerry, (ou est-ce que je dois dire "M. Rocteur"?),
that I understand C quite well, which is why I often use perl,
at least when awk will not suffice.

:You use your skills as best as you can, as long as you know yours and
:your tools limitations, but C does not have many :-)

If you believe this, then you are clearly unfamiliar with the C
programming language.  There are issues of programmer efficiency and
administrator efficiency that are directly compromised when one elects C
in the face of sh/sed/awk or perl solutions.  I've written on this before,
and others have written about this matter in these threads, so I will 
not repeat myself, at least for now.

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist
Unix is like a toll road on which you have to stop every 50 feet to
pay another nickel.  But hey!  You only feel 5 cents poorer each time.
	--Larry Wall in <1992Aug13.192357.15731@netlabs.com>
From: rgasch@nl.oracle.com (Robert Gasch)
Newsgroups: comp.unix.shell
Subject: Sed with shell variables
Date: 20 Aug 92 08:04:07 GMT
Organization: Oracle Europe

Using sed to edit strings is usually a nice and practical
method of doing so. I you want to change a pattern you usually
say:
	echo $something|sed 's/pattern1/pattern2/'

The problem I ran into is that I can't get shell variables to
work as arguments. When I type
	echo $something|sed 's/$this_pattern_var/$that_pattern_var/'

sed throws up on me. I've tried various combinations of quotation
marks without success. Is there an easy way of doing this??

Thanks a lot
---> Rob

Newsgroups: comp.unix.shell
From: dman@netcom.com (Dallman Ross)
Subject: Re: Help: how to keep spaces in args
Date: Wed, 19 Aug 92 21:27:46 GMT
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
X-Newsreader: Tin 1.1 PL4

stuart@wstuart (Stuart Hood) writes:
: Basically I want the following program to output "Hi there",
: rather than just "Hi"

Email to you bounced:


I can't help with the script; but I can help with the English grammar.

Please, please, if you're going to have a script to greet people (even
only yourself), put a comma after the "Hi."

That is, the correct punctuation is "Hi, there."

<It's also "Hi, Stuart" -- even though 80% leave out the comma.>

Not a flame.  Just a mission.  :-)

--
 __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|_____________________|_
From: steiny@steiny.com (Don Steiny)
Newsgroups: comp.unix.shell
Subject: Re: sending mail from shell
Date: 21 Aug 92 20:16:05 GMT
Organization: Don Steiny Software, Santa Cruz CA



mail user <<EOF
bunch of stuff
EOF


will do the trick.   "EOF" is an arbitrary symbol coming after the << and
when it appears on a line by itself it terminates the input.   Command
and variable substitution takes place.   You can stop it by putting the
EOF in quotes (any kind) after the <<

-don
-- 
Don Steiny
Don Steiny Software
Santa Cruz, CA 95060
(408) 425-0382
From: gsa@alcor.concordia.ca ( CON U GRADUATE STUDENTS' ASSOC )
Newsgroups: comp.unix.shell
Subject: Password protection for terminal via shell.
Date: 12 Aug 92 16:58:53 GMT
Organization: Concordia University, Montreal, Quebec

Someone sent me a shell script that is supposed to password
protect your terminal, yet for some reason it doesn't seem
to be working.  Can someone tell me what's wrong with this?
 
:
#
trap "echo Working on Process;stty echo;kill $$" 2 15
SECRET="secret"
stty -echo
echo "Lock string: \c"
read BUF1
echo
while :
do
 BUF2= `line < /dev/tty`
if [ "$BUF2" = "$BUF1" ]
then break
elif [ "$BUF2" = "$SECRET" ]
then break
fi
echo "^G\c"
done
stty echo

---------
Dan.
Newsgroups: comp.unix.shell
From: ckd@eff.org (Christopher Davis)
Subject: Re: Octal chmod status
Organization: Electronic Frontier Foundation Tech Central
	<104.22185@incc.com> <1992Aug20.025036.12745@news.eng.convex.com>
	<ASH.92Aug20105324@ulysses.mr.ams.com>
Date: Fri, 21 Aug 1992 21:17:30 GMT

Alan> == Alan Harder <ash@ulysses.mr.ams.com> 

 Alan> Maybe this thread belongs on alt.talk.religion.  Believe me, many
 Alan> people out there think we're *all* crazy for working with *unix*
 Alan> boxes.  This problem would obviously be easier to solve in cobol
 Alan> on an AS400 machine ;-).

On one occasion, before I learned perl, I had to reformat a data file
(turns out the stats program had to have spaces between each number, but
we didn't know that when we entered the data :-).  Since it was on an
IBM mainframe, we didn't have perl, I couldn't figure out a quick way to
do it with XEDIT, and I couldn't ftp it to a UNIX account because I
didn't have one then.

So I wrote a COBOL program to read in an 80-character line and copy it
to a 160-character line (with interspersed spaces).  It was a brutal,
ugly hack, but it saved a hell of a lot of time.

I'm glad I have perl now :-)
--
Christopher Davis * ckd@eff.org * System Administrator, EFF * +1 617 864 0665
            ``Ed Gruberman, you fail to grasp Ti Kwan Leep.
            Approach me that you might see.'' -- The Master
From: cjross@bbn.com (chris ross)
Newsgroups: comp.unix.shell
Subject: Re: unwinding $variables in csh
Keywords: resolve, unwind $variables, csh
Date: 13 Aug 92 13:26:56 GMT
NNTP-Posting-Host: bbn.com

stilley@csr.UVic.CA (Scott  Tilley) writes:

>What is the easiest way to completely resolve variables in csh? I have
>several variables that are made up of other $variables. I do not
>want them expanded until the end of the script, so I use

>	set var1 = '$HOME'
>	set var2 = '$var1/dir'

Use a while/eval loop, with continuation conditional on
the presence of '$' in your variable:

while ($var2 =~ *\$*)
	eval "set var2 = $var2"
end


chris ross   <cjross@bbn.com>   BBN Advanced Simulations   (617) 873-3272
 WARNING: article may contain flammable material.  Do not expose to open
   flames.  In case of accidental ignition, douse keyboard with water.
From: tlg@uknet.ac.uk (Tim.Goodwin)
Newsgroups: comp.unix.shell
Subject: Re: If shell command switches.
Date: 18 Aug 92 08:49:12 GMT
Distribution: comp.unix.shell
Organization: UKnet

In article <4755@daily-planet.concordia.ca> gsa@alcor.concordia.ca ( CON U GRADUATE STUDENTS' ASSOC ) writes:
>does anyone know where I can find the complete switch listing 
>of the "if" statement?  I can't seem to find it anywhere..ie:
>man csh/tcsh/ksh.., yet I know of the if [-f] and if [-r] 
>...

Try

    man test

(Obvious, huh?)

Tim.
-- 
perhaps if people had understood fork() better we | ; who am i
wouldn't have threads - Rob Pike.                 | uknet.ac.uk!tlg
Newsgroups: comp.unix.shell
From: peter@merlin.acadiau.ca (Peter Steele)
Subject: Array and looping in Bourne Shell
Organization: Acadia University
Date: Sat, 22 Aug 1992 01:43:39 GMT

I need to write a script that takes a list and generates
various permutations of that list, e.g., if the list is
"a b c", I want to generate the following data sets:

a a
a a,b
a a,b,c
a,b a,b
a,b a,b,c
a,b,c a,b,c

What's the best approach to accomplish this in Bourne shell?
--
Peter Steele        Unix Services Manager            peter.steele@acadiau.ca 
Acadia Univ., Wolfville, NS, Canada B0P 1X0  902-542-2201  Fax: 902-542-4364
From: fitzgb@mml0.meche.rpi.edu (Brian Fitzgerald)
Newsgroups: comp.unix.shell
Subject: challenge: hex sort
Date: 13 Aug 92 05:37:40 GMT
Organization: Rensselaer Polytechnic Institute, Troy, NY

For your amusement: :-)

Write a shell script to sort hex in numerical order.

Brian
From: friedman@gnu.ai.mit.edu (Noah Friedman)
Newsgroups: comp.unix.shell
Subject: Re: isatty in Korn shell
Date: 13 Aug 92 09:03:50 GMT
Organization: Free Software Foundation, 675 Mass Ave. Cambridge, MA 02139
In-reply-to: bryan@netcom.com's message of 11 Aug 92 23:15:26 GMT

In article <683mp4q.bryan@netcom.com> bryan@netcom.com (Bryan Higgins) writes:
>How can I test in a Korn Shell script if standard input is a tty?

   At least some versions of ksh have a builtin test with a `-t' operator
that accepts a file descripter as an argument.  Stdin is `0'.  For more
information, read your man page.
From: kevinl@tisdec.tis.tandy.com
Date: 20 Aug 92 07:35 CDT
Newsgroups: comp.unix.shell
Subject: Re: How can I rm a file with a '&' ????
Message-ID: <28300002@tisdec.tis.tandy.com>
Nf-ID: #R:<S025H1G@obh.in-berlin.de>:-26:tisdec.tis.tandy.com:28300002:000:518
Nf-From: tisdec.tis.tandy.com!kevinl    Aug 20 07:35:00 1992


	You can try 'rm -i *', or you can try using a hex editor on your
directory and changing the files name slightly, like replacing the '&'
with an 'A', and then removing the file.
	You could also try piping a directory listing through awk like
this:

	ls -l | awk '{if(index($8, "&")) system("rm " $8)}'

where $8 is the eighth column in you're long listing of the directory.
If the file name appears in another column, adjust the number accordingly.
The first column is $1 ($0 is the whole line).

Hope this helps! 8-)

Newsgroups: comp.unix.shell