[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 38



On Fri, Aug 27, 2010 at 10:30:07AM +0400, Stanislav Maslovski wrote:
> On Fri, Aug 27, 2010 at 12:22:08AM +0200, posion bit wrote:
> > There are 38 unquoted $i in /etc in i386 installing base+laptop+standar
> > 
> > There are 172 "$i" (maching without spaces around) 38 of them matches
> > whit spaces around (unquoted).
> > 
> > Some are iteration numbers, some are directory, files, etc...

> > 
> >     grep -R ' $i ' /etc/ | grep -viE '(binary|no such)'

> So, what is the problem with this? Both usages are legitimate (if one
> understands what she is doing, of course).

touch "o rly?"

While many of these are false alarms (numbers, fixed names, ...), the
problem is real.  Sometimes you even have a proper and improper usage on the
same or on subsequent lines:

(/etc/mc/mc.menu)
          case "$i" in
            *.tar.gz)  D="`basename $i .tar.gz`";;

Especially files that came from Windows are likely to have spaces in their
names.

I just don't get why posion singles out $i among all other possible variable
names.  Or /etc/ when that's not the main place where you find scripts in.

-- 
1KB		// Microsoft corollary to Hanlon's razor:
		//	Never attribute to stupidity what can be
		//	adequately explained by malice.


Reply to: