changing file permissions

Use the following to Change permission of fileB (fileB could be fileB*) to change its permission same as the permission of fileA.

chmod `ls -l fileA | awk '{pr
int "u+", substr($1,2,1), substr($1,3,1), substr($1,4,1), ",g+", substr($1,5,1),
substr($1,6,1), substr($1,7,1), ",o+", substr($1,8,1), substr($1,9,1), substr($
1,10,1)}' | sed 's/-//g' | sed 's/ //g'` fileB