Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!sceard!mrm From: mrm@sceard.UUCP (M.R.Murphy) Newsgroups: comp.unix.wizards Subject: Re: Worm/Passwords (really: 'rm *') Message-ID: <864@sceard.UUCP> Date: 18 Nov 88 22:40:54 GMT References: <22401@cornell.UUCP> <4627@rayssd.ray.com> <8563@rpp386.Dallas.TX.US> <125@embossed.UUCP> <672@quintus.UUCP> <466@yarra.oz.au> Reply-To: mrm@sceard.UUCP (0040-M.R.Murphy) Organization: Sceard Systems, Inc., Carlsbad, CA 92009 Lines: 24 In article <860@sceard.UUCP> I (0040-M.R.Murphy) wrote: |I think that the following shell script does about what is asked for. The |idea is to use existing tools rather than change exisiting tools. | |#! /bin/sh - |if test `echo "$*" |wc -w` -gt 5 |then | echo ": expands to more than 5 arguments, are you sure? \c" | read answer | if test "$answer" != "yes" -a "$answer" != "y" | then | exit 1 | fi |fi |#change "echo" below to the command(s) that you feel like doing for $* |echo $* And I should know that `echo "?#"` is preferable to `echo "$*" |wc -w` because it is faster. More than one way to skin a cat (no offense to cat lovers :-)