[alt.hackers] Real Men pipe to sh

steve@amidillo.UUCP (Stephen ("The Armadillo with the Mask") Okay) (05/07/91)

Here's something I cooked up to keep everybody 'cept me off our operator
consoles. People learn not to use a certain tty real quick. (Yeah, I know 
I could hack login.c, but this was so much more fun! }:) )

whosit=`who|grep sometty|awk '{print $1}'`;export whosit
if test $whosit
   then 
 if grep $whosit someuserlist >/dev/null
      then
      exit
else
echo >/dev/sometty " INSERT OBNOXIOUS MESSAGE HERE"
 ps -tsometty|sed '/PID/d'|awk '{printf("kill -9 %s\n",$2)}'|sh
fi
else 
    exit
fi

--
-----------------
---Brought to you by ARMnet....The only USENET node run by an all armadillo
   staff   amidillo!steve@uunet.uu.net    |BEWARE THE THOUGHT POLICE!
    // "You'll think I'm dead, but I sail |POLITICALLY CORRECT IS INCORRECT!!
 \\//   away..On a wave of mutilation..wave of mutilation...wave.."--Pixies   

subbarao@PHOENIX.PRINCETON.EDU (Kartik Subbarao) (05/09/91)

In article <steve.6025@amidillo.UUCP> steve@amidillo.UUCP (Stephen ("The Armadillo with the Mask") Okay) writes:
>Here's something I cooked up to keep everybody 'cept me off our operator
>consoles. People learn not to use a certain tty real quick. (Yeah, I know 
>I could hack login.c, but this was so much more fun! }:) )
>

Sorry - sh just doesn't cut it. Real men use perl :-)

#! /usr/local/bin/perl

while (</dev/pty*>) {
	open($i++, $_);
}

for (;;) {;}

This'll keep EVERYONE off of your machine (as far as a tty is concerned).

			-Kartik
--
internet% ypwhich

subbarao@phoenix.Princeton.EDU -| Internet
kartik@silvertone.Princeton.EDU (NeXT mail)  
SUBBARAO@PUCC.BITNET			          - Bitnet

subbarao@phoenix.Princeton.EDU (Kartik Subbarao) (05/09/91)

In article <steve.6025@amidillo.UUCP> steve@amidillo.UUCP (Stephen ("The Armadillo with the Mask") Okay) writes:
>Here's something I cooked up to keep everybody 'cept me off our operator
>consoles. People learn not to use a certain tty real quick. (Yeah, I know 
>I could hack login.c, but this was so much more fun! }:) )

Sorry - sh just doesn't cut it. Real men use perl :-)

#! /usr/local/bin/perl

while (</dev/pty*>) {
	open($i++, $_);
}

for (;;) {;}

This'll keep EVERYONE off of your machine (as far as a tty is concerned).

			-Kartik
--
--
internet% ypwhich

subbarao@phoenix.Princeton.EDU -| Internet
kartik@silvertone.Princeton.EDU (NeXT mail)  
SUBBARAO@PUCC.BITNET			          - Bitnet

pfalstad@phoenix.princeton.edu (Paul Falstad) (05/10/91)

subbarao@phoenix.Princeton.EDU (Kartik Subbarao) wrote:
>In article <steve.6025@amidillo.UUCP> steve@amidillo.UUCP (Stephen ("The Armadillo with the Mask") Okay) writes:
>>Here's something I cooked up to keep everybody 'cept me off our operator
>>consoles. People learn not to use a certain tty real quick. (Yeah, I know 
>>I could hack login.c, but this was so much more fun! }:) )
>
>Sorry - sh just doesn't cut it. Real men use perl :-)
...
>for (;;) {;}

Real men don't use busy waits.  Try "sleep;".

>This'll keep EVERYONE off of your machine (as far as a tty is concerned).

Interesting, though it's not what the original poster was talking about.

--
              Paul Falstad  pfalstad@phoenix.princeton.edu
         And on the roads, too, vicious gangs of KEEP LEFT signs!
     If Princeton knew my opinions, they'd have expelled me long ago.