#!/usr/local/bin/perl -w my $tarPath = "/path/to/place/tar/file"; my $fileName = "/path/to/file"; my $command = "tar xvf "; $message = system ($command $tarPath $fileName); if ($message == 0) { print "All done!\n"; } else { print "Whoops! $command gave exit error: $?\n"; }
MadraghRua
yet another biologist hacking perl....
----------------------------------------------------
UPDATE
You might want to stick a my in front of $message to satisfy the -w switch - sorry!
In reply to Re: command to tar files
by MadraghRua
in thread command to tar files
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |