*BSD News Article 35859


Return to BSD News archive

Xref: sserve comp.unix.bsd:14903 comp.unix.programmer:20133 comp.unix.questions:55114 comp.unix.shell:17789
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!swrinde!emory!darwin.sura.net!news.sesqui.net!uuneo.neosoft.com!pluto.neosoft.com!not-for-mail
From: smace@pluto.neosoft.com (Scott Mace)
Newsgroups: comp.unix.bsd,comp.unix.programmer,comp.unix.questions,comp.unix.shell
Subject: Re: <Q> Is there a script for ...?
Date: 15 Sep 1994 23:19:59 -0500
Organization: NeoSoft Internet Services   +1 713 684 5969
Lines: 63
Message-ID: <35b6df$sfo@pluto.neosoft.com>
References: <Pine.3.89.9409150511.A14429-0100000@worf.uwsp.edu>
NNTP-Posting-Host: pluto.neosoft.com

In article <Pine.3.89.9409150511.A14429-0100000@worf.uwsp.edu>,
Peter Zuge <pzuge@worf.uwsp.edu> wrote:
>    
>BSD/386:
>
>I was wondering if there are some scripts for the following:
>   (I am pretty sure that someone else must have wanted these
>    at some time)
>
>  1) A script that will let a user re-edit the last command.  
>     Maybe grabbing it from history and using some editor to modify the 
>     command before executing it?  When creating scripts, I end up test-
>     ing parts of it out on the command line.  These command lines get 
>     pretty lengthy and I would like a way to "grab" it and simply change
>     a parameter then execute it again. ( Like DOSKEY or F3 in DOS? )

run tcsh as your shell, then you can use the up-arrow to scroll through commands

>
>  2) A script that will make it easy to kill numerous jobs.
>     ( I sometimes make some jim-dandy mistakes ) 
>     Coping four or five PIDs down correctly on the command line is
>     almost more than my typing skills can take.;-)

kill -9 `ps -ax |grep "name of process" |awk '{print $1}'` would do it
though be very careful with this if you are root.... 

>
>  3) A notify script that will tell me when a certain user logs in.
>     Maybe even notify me if a certain user logs onto a remote machine?

hmm maybe make a background script that does a write(1) to you everytime
grep matches a pattern from the output of who(1)


There is a series of O'Reily books on unix system admin that would be helpful.

>
>Thanks in advance!
>
>PS
>I do not know of any good sites to ftp to for unix scripts so I thought 
>this would be the best place to ask.  I enjoy creating shell scripts but
>between classes and work my unix play-time is almost nil.:-(
>
>                               <<<<
>                             o(0-0)o
>         ------------------ooO-(_)-Ooo------------
>              Peter A. Zuge              
>              U of Wisconsin, Stevens Point 
>              Information Technology                   
>         -----------------------------------------
>              Gopher:  gopher.uwsp.edu     
>              e-mail:  pzuge@worf.uwsp.edu
>
>
>


-- 
Scott Mace -- NeoSoft Operations (unix systems)                (713)-685-7023
smace@pluto.neosoft.com
smace@neosoft.com                  (713)-684-5969 (Network Operations Center)