Path: utzoo!attcan!uunet!seismo!sundc!rlgvax!hadron!jsdy From: jsdy@hadron.UUCP (Joseph S. D. Yao) Newsgroups: comp.unix.wizards Subject: Re: Worm/Passwords (really: 'rm *') Summary: Shell script fails when ... Message-ID: <815@hadron.UUCP> Date: 22 Nov 88 17:44:51 GMT References: <22401@cornell.UUCP> <4627@rayssd.ray.com> <8563@rpp386.Dallas.TX.US> <125@embossed.UUCP> <672@quintus.UUCP> <466@yarra.oz.au> <860@sceard.UUCP> Reply-To: jsdy@hadron.UUCP (Joseph S. D. Yao) Organization: Hadron, Inc., Fairfax, VA Lines: 18 In article <860@sceard.UUCP> mrm@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@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 /