How to find the directory structure from the current node?



Hi,

I'm reformulating my question since it was missing a key element.


From a shell script, I'd like to put into a variable the last
directory node from the current node, using the "ls -R" command since
the script doesn't have a clue of the directory structure where it
resides.

As an example, suppose you have the following structure:
/disk1/apps/incoming/dir1/dir2/dir3/dir4

And the script is running from: /disk1/apps/incoming/

I'd like to put this into a variable:
"dir1/dir2/dir3/dir4"

using the "ls" command (or something else) piped in some way.

Thanks in advance for your tips.
.



Relevant Pages