Let’s say my script is running inside a folder, and in this folder is anther folder with a name that can change each time I run the script. How can I find the name of that folder ?
Edit :
As an example, let’s say my script is running in the folder /testfolder, which is known and does not change.
In /testfolder there is another folder : /testfolder/randomfolder, which is unknown and can change.
How do I find the name of /randomfolder ?
I hope it’s clearer, sorry for the confusion.
Assuming there is exactly one subdirectory:
If you don’t have GNU find, then