1.read a source.txt
2.untar special.tar.gz into these directory in source.txt
3.i want to change untar all files ownership rightly
4.chmod 755 untar all files .
ex)
!!!!!! first line
untar special.tar.gz -xvfz /home/user409/public_html/test/
and cd /home/user409/public_html/test
and chown -R user409:user409 *
and chmod -R 755 *
!!!!!!second line
untar special.tar.gz -xvfz /home/user09876/public_html/xdsss/
and cd /home/user09876/public_html/xdsss/
and chown -R user09876:user09876 *
and chmod -R 755 *
.
.
.
.
.
.
.
.
#!/bin/ksh
while read line
do
usr=${$line%/public_html/*} # assumes directory after user is always "/public_html"
usr=${usr#/home/} # assumes user directory is always in /home"
untar special.tar.gz -xvfz $line
chown -R $usr:$usr $line # should be no need to cd if last directory is okay
chmod -R 755 $line # to be owned by $usr. If not use cd "$line"
done < source.txt # command and replace "$line" in chown & chmod
# with "*"