I have a script that uses a find command to find some directory names I need but the output has them in the same string and with an extra level of path I don't need. I want to split them, cut out the part I don't need, and add them each to an array.
find command:
projects=$(find Un -maxdepth 1 -type d -name 'Proj_*')
find command result (stored as $projects in the script):
Un/Proj_ABCD4 Un/Proj_EF2GH Un/Proj_PG5T3 Un/Proj_MMXCU
What I want to put in the array:
Proj_ABCD4
Proj_EF2GH
Proj_PG5T3
Proj_MMXCU