Good job. Here are a few suggestions for you to improve it even more.
If you're using bash version 4, there's a new globbing expression "**" that lets you work on a recursive directory tree.
Code:
shopt -s globstar #turns it on if it isn't already.
for SRCFILE in /home/robert/Pictures/**
However, both this and your original will try to process everything in the tree, including subfolder names. It might be better to use find to filter out just the files you want.
Code:
for SRCFILE in $(find /home/robert/Pictures -type f -name "*.jpg")
Also, you shouldn't use backticks anymore. $() is
the recommended way to embed commands.
Next, two comments concerning the sed command.
You can avoid the "picket fence" effect by changing the separator used in the s/// command. sed can use just about any ascii character, not just /.
Code:
RELPATH=$(echo $SRCFILE | sed -e 's%/home/robert/Pictures/%%')
But in this case you can avoid using sed entirely with another form of
parameter substitution. (you will need to use backslash escapes here, however).
Code:
RELPATH=${SRCFILE/\/home\/robert\/Pictures\//)
Keep up the good work.