Some bash tricks, just to remember them,,,
Read the file using cat:
cat file.txt | while read line
do
echo "${line}"
done
Or read a list of files using find:
find -iname "*.mp3" | while read line
do
echo "${line}"
done
$ tar xzvf - /home/user/dir | ssh user@server "dd of="/dest/dir/file.tar.gz
scriptdir=$(cd $(dirname $0); pwd -P)