# $1 is the base folder # $2 is the full path to the file to copy subfolder="$1/$(/usr/bin/getpicfolder.sh $2)" stat "$subfolder" if [[ "$?" = "1" ]] then mkdir $subfolder fi cp "$2" "$subfolder"