Hello all,
Can somebody explain to me how set up a basename and dirname variable to simplify this script. I currently have a 'infile' with the contents of FTTPDataPVC_ & BaaisDSLFeed. I need to add a basename and or dirname variable so that any additions can be made through the infile and not... (1 Reply)
Hello,
i have another sed question.. I'm trying to do variable substition with sed and i'm running into a problem.
my var1 is a string constructed like this:
filename1 filerev1 filepath1
my var2 is another string constructed like this:
filename2 filerev2 filepath2
when i do... (2 Replies)
Hi guys if i do
a=`basename -e -s /home/j/john/*`
du -k -h $a | sort -nr | head -10
why when i run the script does it work but also say usage basename string
any ideas thanks (9 Replies)
Hi,
can anyone let me know how to interpret the below third line in the following code.
Gone through the man pages of "basename", but no go.
for f in *.foo;
do
base=`basename $f .foo`
mv $f $base.bar
done
Thanks. (2 Replies)
im trying to extract the basename of a process running on a host
processx is running at host1 as /applications/myapps/bin/processx
i wanted to check if its running, then extract the basename only using:
$ ssh host1 "ps aux | grep -v 'grep' | grep 'processx'" | awk '{ print basename $11}'
... (10 Replies)
Hi All,
I would like to improve my bash scripting skill and found a problem which I do not understand. Task is to search and print files in directory (and subdirecories) which contains its own name. Files can have spaces in name.
This one works fine for files in main directory, but not for... (4 Replies)
This is a two part request for an assistance.
I am not sure how retrieve value from basename command - line 270 -so in can be output as variable CLI_COMMAND - line 250 in whiptail input box.
As coded I can input from keyboard ( stdin?) into input box using redirection.
I can... (2 Replies)
Discussion started by: annacreek
2 Replies
LEARN ABOUT DEBIAN
arch::tarball
Arch::Tarball(3pm) User Contributed Perl Documentation Arch::Tarball(3pm)NAME
Arch::Tarball - an interface to create and work with tarballs
SYNOPSIS
use Arch::Tarball
my $tarball = Arch::Tarball->new;
my $pipe = $tarball->create(
dir => '/path/to/subdir-to-pack',
base_name => 'new-subdir-to-pack',
pipe => 1,
);
DESCRIPTION
Arch::Tarball provides an object oriented interface to work with (create, examine or extract) standard gzipped tarballs.
Note: As functionality is added only when needed, a lot of features are currently not implemented.
METHODS
The following functions are available:
new, create, extract, list.
new %opts
Creates a new Arch::Tarball object.
The following parameters can be set via %opts:
tar The name of the tar executable. Defaults to "tar".
file
The filename of the Tarball.
create %opts
Creates a new tarball (tar.gz) from a given directory structure.
create understands the following options:
dir (mandatory)
Specifies the base directory for the tarball. The given directory and recursively its content will be added to the tarball. The
directory's basename will be used as the first and the only subdirectory in the tarball.
base_name
Allow the programmer to specify a different base directory name for the tarball content than the basename of dir. In this case,
'cp' process is launched to temporarily rename the last element of dir.
pipe
When set, create does not create a physical tarball but writes the tarballs content to a newly created pipe. The pipe is returned
by the create method.
Note: Currently the pipe option is mandatory.
extract %opts
Extracts the tarball to a given target directory, specified by dir option. If dir option is not given, a temporary directory is
created that will hold the extracted dirs/files. This directory is returned.
The file option specifies the tarball file name. It may be given in the constructor instead.
list %opts (not implemented yet)
Returns a list of files and directories in the tarball.
BUGS
Most functionality is currently not implemented. If you need part of the missing functionality, please contact the authors.
Patches are greatly appreciated.
AUTHORS
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).
Enno Cramer (uebergeek@web.de--2003/arch-perl--devel).
perl v5.10.1 2005-04-22 Arch::Tarball(3pm)