[X-Unix] script question (cron - adobefnt*.lst)

Don Montalvo dmjgraphics at nyc.rr.com
Fri Jan 9 09:45:31 PST 2004


how's this for a cron job (i removed all double quotes and kept the 
backslash near the end...mixed the two original examples):

	find / -name 'AdobeFnt*.lst" -exec rm -f {} \;

wow...never knew the decision to use single or double quotes had such 
a huge impact on shell scripts!

:)
don

eugene lee wrote:

>On Thu, Jan 08, 2004 at 03:58:20PM -0500, Don Montalvo wrote:
>
>: these two seem to do the same thing:
>:
>:	find / -name 'AdobeFnt*.lst' -exec rm -f {} \;
>:
>:		(and)
>:
>:	find / -name "AdobeFnt*.lst" -exec rm -f {} ';'
>:
>: first question: which script is best for using as cron job?
>
>After the shell is done with variable expansion, both of these forms:
>
>	find / -name 'AdobeFnt*.lst'
>	find / -name "AdobeFnt*.lst"
>
>come out to the same thing.  However, the single-quoted string allows
>less escape characters than the double-quoted string.  The former may be
>better if you are trying to list files that contain unusual characters
>like the dollar sign ('$').
>
>--
>Eugene Lee
>http://www.coxar.pwp.blueyonder.co.uk/

Robar J Philip <philip.robar at myrealbox.com> wrote:

>On Jan 8, 2004, at 1:20 PM, Juan Manuel Palacios wrote:
>
>  > find -x / -name "AdobeFnt*.lst" -exec rm -f {} \;
>  >
>  > Read about it in the man page for a more complete explanation than
>  > what I can reproduce here. Finally, I'd double quote the searched
>  > string with wild card just to be safe..., call me paranoid!
>
>Actually double quotes are less "safe". Double quotes allow for
>variable interpolation before the string gets to find-which you don't
>want. Use single quotes to preserve the wild cards in the search
>string.
>
>Phil



More information about the X-Unix mailing list