Wondering if there is a best way to call directory names and iterate as parameter from a list.
Example
cat /dropbox/script/DirList.txt
DIR_A
DIR_B
DIR_C
DIR_D
/dropbox/dev/inbox/<DIR_A>/ *.*
/dropbox/dev/inbox/<DIR_B>/ *.*
/dropbox/dev/inbox/<DIR_C>/ *.*
/dropbox/dev/inbox/<DIR_D>/ *.*
considering folders/directories already exist If file exist in each of the mentioned directories then move them to outbox
mv /dropbox/dev/inbox/<DIR_D>/ *.* to /dropbox/dev/outbox/<DIR_D>/ *.*
I tried
if [ -d /dropbox/dev/inbox/<DIR_D>/ ]; then
mv /dropbox/dev/inbox/<DIR_D>/ *.* to /dropbox/dev/outbox/<DIR_D>/
fi
<
s and>
s in them? – DopeGhoti Jan 02 '19 at 22:20/dropbox/dev/inbox/<DIR_A>/ *.*
Did you intentionally put a space there? Do you want to glob all files in that directory with an extension? – jesse_b Jan 02 '19 at 22:21rsync --remove-source-files
to me. – DopeGhoti Jan 02 '19 at 22:21/dropbox/dev/inbox/DIR_A/ /dropbox/dev/inbox/DIR_B/ /dropbox/dev/inbox/DIR_C/ /dropbox/dev/inbox/DIR_D/
– user2292524 Jan 02 '19 at 22:27