SCIENTIFIC-LINUX-USERS Archives

February 2015

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Brad Cable <[log in to unmask]>
Reply To:
Brad Cable <[log in to unmask]>
Date:
Fri, 27 Feb 2015 19:27:05 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (26 lines)
Major nit...

You really shouldn't ever generate a dynamic script from within another 
and then execute it.  Depending on umasks, location, etc, you never know 
what could be done with the file after your initial creation and before 
execution occurs.

This is why mktemp exists.

-Brad


On 02/27/2015 07:21 PM, ToddAndMargo wrote:
> On 02/27/2015 05:11 PM, John Lauro wrote:
>> Minor nit...  I think your script will have a problem if there is a 
>> space in the filename...  the find -print0 | while read example 
>> should handle spaces...
>
> Not so minor.  I am trying to always remember to surround my stuff in
> quotes.  Just like you see me using ${xx} instead of $xx and $()
> instead of ``
> Revised line:
>
> find -maxdepth 1 -iname \*.pdf -exec echo 
> "\"/opt/pdfstudio9/pdfstudio9\" \"{}\" &" \; >> "${Tmp}"

ATOM RSS1 RSS2