Re: don't want to mkdir if it already exists



On 2007-04-05, paintedjazz@xxxxxxxxx wrote:
....
However, I have discovered one more issue that is slightly related.
Besides the my.thumbnails subdirectory, my script also creates
subdirectories
entitled my.padded and my.flexible and this (using the find command)
is what my script is creating now:

./ImageGallery/my.flexible # GOOD
./ImageGallery/my.padded # GOOD
./ImageGallery/my.padded/my.flexible # BAD
./ImageGallery/my.padded/my.thumbnails # BAD
./ImageGallery/my.thumbnails # GOOD
./ImageGallery/my.thumbnails/my.flexible # BAD
./ImageGallery/my.thumbnails/my.padded # BAD

my.flexible and my.padded and my.thumbnails
should never be subdirectories of each other.
Now all three use the same case statement as above.
Is there a way that I could modify the case statement
to prevent this?

It looks as if you have a nested loop. Remove it.

If that doesn't solve the problem, post your script.

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell/>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
.



Relevant Pages

  • Copying and insuring directory and subdirectory contents have been synchronized.
    ... TEST subdirectories. ... room to hold two copies of the file while the copy command completes. ... the individual files after the global copy or better yet, have a better, ... I was also thinking of building a script with rm commands in it for some ...
    (AIX-L)
  • opendir and if -d $files problem
    ... subdirectories on a given path ... When I run this on the same path as the script is located it ... but not the PROGRAM FILES or some ... I am using Perl 5.8 on a Windows XP machine. ...
    (comp.lang.perl)
  • Re: Apply security settings or take ownership: access denied.
    ... > not search in subdirectories by itself, I used a script that looped ... This is the .vbs script, ... > Dim objFileSystem ... > Set objFileSystem = Nothing ...
    (microsoft.public.windows.server.security)
  • Re: Recursively change all occurrence of a word in a directory
    ... > I want to recursively change all occurence of a word in a director and ... > its subdirectories, is there a simple script I can use for doing that? ...
    (comp.unix.bsd.freebsd.misc)
  • matlab keeps running my old scripts
    ... This problem has been occuring recently. ... I have a script which calls ... other scripts (subscripts, if you will) that are in subdirectories. ... These subdirectories are in my path so it has no problems finding the ...
    (comp.soft-sys.matlab)