The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-02-2009
ejdv ejdv is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 46
[Perl] Determine directory name

Hi there,

I wonder if it is possible the determine a name of a directory which is different on various hosts.

Let me try to explain.

I have the directory /tmp/dir1/dir2/canchangedir.
This directory name is different on various hosts.
I need to use the directory name, independent from the host I am on.

This is the directory structure on all hosts (example):

/tmp/dir1
/tmp/dir1/dir2
/tmp/dir1/dir2/canchangedir
/tmp/dir1/dir2/canchangedir/dir3
/tmp/dir1/dir2/file1
/tmp/dir1/dir2/file2
/tmp/dir1/dir2/file3

The name "canchangedir" is different on all hosts.
The structure is the same and the dir1 and dir2 name too.

I tried with find and basename, but did not succeed.

Anyone out there that can do the magic ??

Thanks,

E.J.