I have a file that looks like this:
ftp://url1/files1.tar.gz dir1
ftp://url2/files2.txt dir2
.... many more...
What I want to do are these steps:
- Create directory based on column 2
- Unix 'cd' to that directory
- Download file with 'wget' based on column1
But how come this approach of mine doesn't work
while(<>) {
chomp;
my ($url,$dir) = split(/\t/,$_);
system("mkdir $dir");
system("cd $dir");
system("wget $url"); # This doesn't get executed
}
What's the right way to do it?