[Top][All Lists]

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

[bug #20245] bad variable substitution?

From: Bob Proulx
Subject: [bug #20245] bad variable substitution?
Date: Sat, 23 Jun 2007 15:52:16 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv: Gecko/20060830 Firefox/ (Debian-1.5.dfsg+

Update of bug #20245 (project findutils):

             Assigned to:                    None => rwp                    
             Open/Closed:                    Open => Closed                 


Follow-up Comment #1:

The problem you have experienced is not a bug in find but is due to 
insufficient evaluation of quoted arguments.  This can be seen by using 'sh
-x' to invoke your test script.

  mask="-name '$2'"
  find $1 $mask -type f -print

  $ sh -x ./script '*txt'
  + mask='-name '\''*txt'\'''
  + find . -name ''\''*txt'\''' -type f -print

The find program is receiving the quote characters.  In your example the find
command needs a shell 'eval' in order to remove one layer of shell quoting.

  mask="-name '$2'"
  eval find $1 $mask -type f -print

I hope this helps.  If it does not resolve your issue then please post again.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]