Hi, I am trying to construct a script for migrating between 2 email servers which use maildir. One of which is using maildir under a chrooted jail for each domain and the other seperates out all email into a seperate folder(non-chroot).
My script thus far is below:
Code:
!/bin/bash
domains=(domain1.com domain2.com domain3.com domain4.com domain5.net)
for i in $domains; do
echo $i
find `find /home -maxdepth 3 -mindepth 3 -type d -name $i` -maxdepth 1 -mindepth 1 -type d
done
This script should look in /home/something/somethingelse for a directory with the same name as each domain in the array and then use the result of that search to see what directories are inside that parent directory. The find command works in the shell and provides the correct output, but when put into this for loop it seems to only provide the result for the first domain in the array, it does not print any further output for domain2.com etc... I'm a little stumped asto why the for loop is not continuing to step through the array.
Thanks, Kerry