http://qs1969.pair.com?node_id=308751


in reply to chmod permission issues

I think you want to look at umask.

But a bigger question is: Why do you want to use perl for this? When you have so many backticks, you should question if perl is the right tool at all.

It is much simpler in shell. For example, in ksh:

umask 002 set -A SERVERS server server2 server3 path="/home/backup/nightly" while (( $i < ${#SERVERS[*]} )); do cp ${path}/${i}/etc_passwd passwds.${i} (( i = i + 1 )) done