12-18-2008
Tree directory structure of Unix to get final node path
Hi,
I want to list all the last directories from mentioned base path.
for eg: If i have a base path say /base/base1/
How can i get the path till last node in tree like directory structure of unix by applying any command.
so that i will get following output.
/base/base1/base2/final1/final2/last
/base/base1/base2/final1/final3/last
/base/base1/base2/final1/last
/base/base1/base2/final1/final4/last
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Does anyone know of a good Internet source that explains the directory structure of Unix/Linux??
Thanks
Gregg (2 Replies)
Discussion started by: gdboling
2 Replies
2. UNIX for Advanced & Expert Users
Hi,
I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies
3. Solaris
I m not able to copy the text present on the tree's node to terminal or other text editor in solaris. I m using <Shift><control> C and V comaand for the same but the text is not being copied and pasted on the text pad or the terminal window.
While the same is possible in windows OS using ctrl+c... (3 Replies)
Discussion started by: friendanoop
3 Replies
4. HP-UX
I m not able to copy the text present on the tree's node to terminal or other text editor in solaris. I m using <Shift><control> C and V comaand for the same but the text is not being copied and pasted on the text pad or the terminal window.
While the same is possible in windows OS using ctrl+c... (2 Replies)
Discussion started by: friendanoop
2 Replies
5. Shell Programming and Scripting
Hello,
I have a file of the following information ( first field parent item, second field child item)
PM01 PM02
PM01 PM1A
PM02 PM03
PM03 PM04
PM03 PM05
PM03 PM06
PM05 PM10
PM1A PM2A
PM2A PM3B
PM2A PM3C
The output should be like this :
PM01 PM02 PM03 PM04
... (2 Replies)
Discussion started by: ThobiasVakayil
2 Replies
6. UNIX for Dummies Questions & Answers
I have a list of software funtions in tcl code. Some of these functions call other functions. I want to build a tree structure of all called functions.
Right now I list all the functions into a file then read this file so that I can cat each function and grep for EXECUTE (command that calls... (0 Replies)
Discussion started by: MissI
0 Replies
7. UNIX for Dummies Questions & Answers
I am creating a hierarchical tree structure and I was wondering what commands I needed to do that. I have 4 directories and sixteen sub directories and 4 files. Thank you for your help in getting my started in right direction.:confused: (1 Reply)
Discussion started by: GreginNC
1 Replies
8. Shell Programming and Scripting
Hi Experts,
I have table in mysql like below:
'user` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`parent_id`
varchar(100) NOT NULL,
`member_name` varchar(100) NOT NULL,
`city` varchar(100) NOT NULL,
`member_id` varchar(100) NOT
NULL,
`password` varchar(100) NOT... (1 Reply)
Discussion started by: naw_deepak
1 Replies
9. Shell Programming and Scripting
Can we create the master file that show the whole tree structure of the directory till a particular folder?
Database that contains four sub repository Sybase,sql,oracle,mysql and sql and oracle contains two subrepostories Siebel and plsql and each repositories contains three folders... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies
10. Shell Programming and Scripting
Hi All,
i am in need of plotting graph ( tree structure ) depends upon my shell script output.
For this requirement, what kind of open source avail in market.
For example: (my script output will be like below )
Parent:A
process-name:child-processes
A:B,C
B: D
expecting... (1 Reply)
Discussion started by: ponmuthu
1 Replies
LEARN ABOUT DEBIAN
forest::tree
Forest::Tree(3pm) User Contributed Perl Documentation Forest::Tree(3pm)
NAME
Forest::Tree - An n-ary tree
SYNOPSIS
use Forest::Tree;
my $t = Forest::Tree->new(
node => 1,
children => [
Forest::Tree->new(
node => 1.1,
children => [
Forest::Tree->new(node => 1.1.1),
Forest::Tree->new(node => 1.1.2),
Forest::Tree->new(node => 1.1.3),
]
),
Forest::Tree->new(node => 1.2),
Forest::Tree->new(
node => 1.3,
children => [
Forest::Tree->new(node => 1.3.1),
Forest::Tree->new(node => 1.3.2),
]
),
]
);
$t->traverse(sub {
my $t = shift;
print((' ' x $t->depth) . ($t->node || 'undef') . "
");
});
DESCRIPTION
This module is a basic n-ary tree, it provides most of the functionality of Tree::Simple, whatever is missing will be added eventually.
This class inherits from Forest::Tree::Pure>, but all shared methods and attributes are documented in both classes.
ATTRIBUTES
node
uid
parent
parent
_set_parent
has_parent
clear_parent
children
get_child_at ($index)
Return the child at this position. (zero-base index)
child_count
Returns the number of children this tree has
size
size
has_size
clear_size
height
height
has_height
clear_height
METHODS
is_root
True if the current tree has no parent
is_leaf
True if the current tree has no children
depth
Return the depth of this tree. Root has a depth of -1
add_child ($child)
add_children (@children)
Add a new child. The $child must be a "Forest::Tree"
insert_child_at ($index, $child)
Insert a child at this position. (zero-base index)
remove_child_at ($index)
Remove the child at this position. (zero-base index)
traverse (&func)
Takes a reference to a subroutine and traverses the tree applying this subroutine to every descendant.
siblings
Returns an array reference of all siblings (not including us)
to_pure_tree
Invokes "reconstruct_with_class" with Forest::Tree::Pure.
to_mutable_tree
Returns the invocant (without cloning).
clone
See "clone" in Forest::Tree::Pure.
This variant will not clone the parent, but return a clone of the subtree that is detached.
get_index_in_siblings
Returns the index of the tree in the list of children.
Equivalent to calling "$tree-"parent->get_child_index($tree)>.
Returns -1 if the node has no parent (the root node).
BUGS
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to
cpan-RT.
AUTHOR
Stevan Little <stevan.little@iinteractive.com>
COPYRIGHT AND LICENSE
Copyright 2008-2010 Infinity Interactive, Inc.
<http://www.iinteractive.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2010-09-27 Forest::Tree(3pm)