files.zip
たとえば、圧縮ファイルを作業ディレクトリとは異なるディレクトリに解凍したいと考えています。たとえば、私の作業ディレクトリは で/home/user/address
、ファイルを解凍したいとします/home/user/name
。
私は次のようにしようとしています
#!/usr/bin/perl
use strict;
use warnings;
my $files= "/home/user/name/files.zip"; #location of zip file
my $wd = "/home/user/address" #working directory
my $newdir= "/home/user/name"; #directory where files need to be extracted
my $dir = `cd $newdir`;
my @result = `unzip $files`;
しかし、作業ディレクトリから上記を実行すると、すべてのファイルが作業ディレクトリに解凍されます。圧縮されていないファイルを にリダイレクトするにはどうすればよい$newdir
ですか?