PTAR(1) Perl Programmers Reference Guide PTAR(1)NAME
ptar - a tar-like program written in perl
ptar is a small, tar look-alike program that uses the perl module
Archive::Tar to extract, create and list tar archives.
ptar -c [-v] [-z] [-C] [-f ARCHIVE_FILE | -] FILE FILE ...
ptar -x [-v] [-z] [-f ARCHIVE_FILE | -]
ptar -t [-z] [-f ARCHIVE_FILE | -]
c Create ARCHIVE_FILE or STDOUT (-) from FILE
x Extract from ARCHIVE_FILE or STDIN (-)
t List the contents of ARCHIVE_FILE or STDIN (-)
f Name of the ARCHIVE_FILE to use. Default is './default.tar'
z Read/Write zlib compressed ARCHIVE_FILE (not always available)
v Print filenames as they are added or extracted from ARCHIVE_FILE
h Prints this help message
C CPAN mode - drop 022 from permissions
SEE ALSO tar(1), L<Archive::Tar>.
perl v5.16.2 2013-08-25 PTAR(1)
Check Out this Related Man Page
CPANPLUS::Internals::Extract(3pm) Perl Programmers Reference Guide CPANPLUS::Internals::Extract(3pm)NAME
### for source files ###
$self->_gunzip( file => 'foo.gz', output => 'blah.txt' );
### for modules/packages ###
$dir = $self->_extract( module => $modobj,
extractdir => '/some/where' );
CPANPLUS::Internals::Extract extracts compressed files for CPANPLUS. It can do this by either a pure perl solution (preferred) with the
use of "Archive::Tar" and "Compress::Zlib", or with binaries, like "gzip" and "tar".
The flow looks like this:
Delegate to Archive::Extract
$dir = _extract( module => $modobj, [perl => '/path/to/perl', extractdir => '/path/to/extract/to', prefer_bin => BOOL, verbose => BOOL, force
=> BOOL] )
"_extract" will take a module object and extract it to "extractdir" if provided, or the default location which is obtained from your
The file name is obtained by looking at "$modobj->status->fetch" and will be parsed to see if it's a tar or zip archive.
If it's a zip archive, "__unzip" will be called, otherwise "__untar" will be called. In the unlikely event the file is of neither format,
an error will be thrown.
"_extract" takes the following options:
A "CPANPLUS::Module" object. This is required.
The directory to extract the archive to. By default this looks something like:
A flag indicating whether you prefer a pure perl solution, ie "Archive::Tar" or "Archive::Zip" respectively, or a binary solution like
"unzip" and "tar".
The path to the perl executable to use for any perl calls. Also used to determine the build version directory for extraction.
Specifies whether to be verbose or not. Defaults to your corresponding config entry.
Specifies whether to force the extraction or not. Defaults to your corresponding config entry.
All other options are passed on verbatim to "__unzip" or "__untar".
Returns the directory the file was extracted to on success and false on failure.
perl v5.12.1 2010-04-26 CPANPLUS::Internals::Extract(3pm)
I need to pass arguments to a shell scripts. but for this i need to take the arguments only if they are supplied to the script as arguments.
Prompt > scriptname -d device_cd -s message
so how do i capture these arguments ?> i think we have to use optarg.but i dont... (5 Replies)
I'm learning how to add in programm another option by command line.
For example in the "my_prog" i want to add a " -k " option and then write a number.
my_prog -k 50
and the i should use the number 50.
I'm reading about getopt_long and optarg, and what i have done in the code... (0 Replies)
Hi I have below code in one of my shell script:
if ; then fail $USAGE; fi
while getopts hz:r:t:dz: o
case "$o" in
h) echo $USAGE ; exit 0;;
r) export REQ_ID="$OPTARG";;
) ... (0 Replies)
Hello i'm writing some analyzing script and i'm giving to my program these parameters, for example:
./procinfo -r tmpfile sh -c "cat tmpfile"
where -r is proccessed in getopts and it takes an argument by OPTARG..
The thing is I need to save this part to some variable:
sh -c "cat tmpfile"... (4 Replies)
I hope, that I do not open an thread, that is already existing, but I didn't found something matching with my problem while searching for problems with "getopts"
My problem ist, that I'm taking arguments from commandline into my script with getopts, I've an flag -s, after that there... (2 Replies)
here is the code
while getopts 1:2:3:4: mode
case $mode in
1)echo "You have chosen mode1"
case $OPTARG in
a) echo "User Specified Date Range"
b) echo "user specified month and year";;
?) echo "Default, Current... (4 Replies)
EDIT: -- SOLVED --
Getting used to optargs, but by far not understanding it.
So i have that script that shall be 'changeable', trying to use the passed arguments to modify the script visuals.
browser -t test -d sect $HOME
Where -t should change the title,
and -d... (0 Replies)
I want to capture space as well from the argument
script.ksh -m "Message from xyz" -e "email@example.com"
script.ksh -m 'Message from xyz' -e 'firstname.lastname@example.org'
I am parsing using getopts, but for option "m" OPTARG is returning only "Message".
Please use code tags next time for... (9 Replies)