Ok I goofed the file is static like /etc/passwd and I am taking it from a backup sub directory and the server is the variable that changes not the file itself, so it should be like:
#! /usr/bin/perl use strict; use warnings; my @SERVERS = ('sneezy','sleepy','dopey','grumpy'); my $path = "/home/backup/"; foreach my $this_server ( @SERVERS ) { `cp $path/$this_server/etc/passwd .`; }
Does this lokk right??
In reply to Re: Re: Hashes or arrays in the command line
by tux242
in thread Hashes or arrays in the command line
by tux242
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |