I am trying to resolve a permissions issue with either a touch from the shell side in an if then equality clause like if file is not present then create file in the script below so i do not have to chmod every 5 seconds through the iteration, any suggestions for this fix using Perl
#! /usr/bin/perl
use strict;
use warnings;
my @SERVERS = ('server','server2','server3');
my $path = "/home/backup/nightly";
foreach my $this_server ( @SERVERS ) {
#`if $this_server eq 0 then touch $this_server`;
`chmod 775 *`;
`cp $path/$this_server/etc_passwd ./passwds.$this_server`;
`chmod 775 *`;
}
Thanks in advance.