#!/bin/csh -f # makealbum_all # ------------------------------------------------------------------------- # Shell script to create and publish picture album and slideshow from # JPG files in current directory and all subfolders. # ------------------------------------------------------------------------- # Show names of folder and tree of subfolders in alphabetic order. # Note: Double quotes outside the backticks cause the list of # filenames, one per line, generated by find, to be quoted # so that embedded whitespace and special chars are tolerated. # The foreach command operates on each line as a filename, # not each word of each line. # Note: The option -type d selects only directories, not symlinks # so we'll stay inside the current directory tree. foreach dir ("`find . -type d \ -not -name slideshow \ -not -name thumbs \ -print \ | sort`") if (-e "${dir}.ignore_for_album_and_slideshow") then echo "Will skip: $dir" continue endif echo "Will process: $dir" end set option_prompt = "true" set action = `promptloop "Make all of the above albums (y/n/p(rompt))? " y n prompt p` if ("${action}" == "n") then exit 0 else if ("${action}" == "y") then set option_prompt = "false" endif # Loop through this folder and its tree of subfolders in alphabetic order. # Note: Double quotes outside the backticks cause the list of # filenames, one per line, generated by find, to be quoted # so that embedded whitespace and special chars are tolerated. # The foreach command operates on each line as a filename, # not each word of each line. # Note: The option -type d selects only directories, not symlinks # so we'll stay inside the current directory tree. foreach dir ("`find . -type d \ -not -name slideshow \ -not -name thumbs \ -print \ | sort`") if (-e "${dir}.ignore_for_album_and_slideshow") then echo "Skipping: $dir ..." continue endif if ("$option_prompt" == "true") then set action = `promptloop "Process $dir (y/n)? " y n` if ("${action}" == "n") then echo "Skipping: $dir ..." continue endif endif echo "Processing: $dir ..." makealbum --directory $dir:q end