That's not it actually. May be I was unable to pin point the problem in my question.
I quoted the whole directory path
/home/user/public_html/directory/subdirectory/
for convenience of readers.
In fact, my question was how to get or define an empty directory as a variable when I only know the possible existence of a down most directory but I don't know it's name.
For example, in the path
/home/user/public_html/directory/subdirectory/
I'm only aware about
/home/user/public_html/directory/-->a sub-directory is here but I don't know the name<--/
but actually there is a sub-directory there named "subdirectory" in the above path which is ever changing.
How shall I define the down most directory "subdirectory" as a variable either using basename or dirname or any other suitable function in this case?
Thanks,