Worm/Passwords (really: 'rm *')

M.R.Murphy mrm at sceard.UUCP
Sat Nov 19 08:40:54 AEST 1988


In article <860 at 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 :-)



More information about the Comp.unix.wizards mailing list