Create Sample and Subs Directory

Come up with a useful post-processing script? Share it here!
Post Reply
knatsch
Newbie
Newbie
Posts: 17
Joined: April 15th, 2009, 7:23 am

Create Sample and Subs Directory

Post by knatsch »

Here is my script which I use to create the Sample and Subs Folders. The Script creates both folders and tries to copy Sample & Subs to their directory. If Sample and/or Subs do not exist, the folder is deleted immediately. I am using this method now for a while and it worked very well for me. Enjoy.

Code: Select all

cd $1
mkdir Sample
mv *sample* ./Sample/
if [ "$?" -ne 0 ]
then
	rm -r Sample
fi
chmod 755 Sample/
mkdir Subs
mv *subs* ./Subs/
if [ "$?" -ne 0 ]
then
        rm -r Subs
fi
chmod 755 Subs/

Post Reply