The 'q' options quits as soon as the file has been extracted, closing the pipeline, thus allowing uncompress to stop as soon as possible. You can then make a script to do all this for you.
No, it extracts that one particular file but creates all the folders leading up to it. So first remove folder1 (rm -rf folder1), do the above command. Then you will see folder1 with only "obj" and inside obj, only "one.txt".
Thanks a lot , I got it in command prompt.Now i need to read through script.
I have used the below code to read tat content of the file through perl script.
$d="uncompress -c test.tar.Z | tar xfq - folder1/obj/one.txt";
open(VERSION,$d) || print ("\nMissing 'INFO' file \n");
while (<VERSION>) {
chop;
$newVersion=$_;
print "$newPerlVersion";
}
close PERLVERSION;
You can actually shorten it just a wee bit. Differences in bold:
system <uncompress/untar command here>
open(VERSION,"folder1/obj/one.txt") || die ("\nMissing 'INFO' file \n");
while (<VERSION>) { print; }
system "rm -rf folder1";