Worm/Passwords (really: 'rm *')

Joseph S. D. Yao jsdy at hadron.UUCP
Wed Nov 23 03:44:51 AEST 1988


In article <860 at sceard.UUCP> mrm at sceard.UUCP (0040-M.R.Murphy) writes:
>#! /bin/sh -
>if test `echo "$*" |wc -w` -gt 5
>	...
>#change "echo" below to the command(s) that you feel like doing for $*
>echo $*

This shell script, and all shell scripts that use "$*" in this manner,
fail in the presence of special characters like white space in file
names.  This is a problem, if you read the (numerous) articles titled
"Ghost file", and the like.

	Joe Yao		jsdy at hadron.COM (not yet domainised)
	hadron!jsdy@{uunet.UU.NET,dtix.ARPA,decuac.DEC.COM}
	arinc,att,avatar,blkcat,cos,decuac,dtix,\
	ecogong,empire,gong,grebyn,inco,insight, \!hadron!jsdy
	kcwc,lepton,netex,netxcom,phw5,rlgvax,	 /
	seismo,sms,smsdpg,sundc,uunet		/



More information about the Comp.unix.wizards mailing list