I am trying to extract, in linux (tcsh), the last part of a delimited string.
For example: I have a string that is /dir1/dir2/dir3 and the output should be only dir3.
The complete task I want to implement is: I want to find directory names that follow a given pattern, but "find"command returns a full path and not only the last directory, which is really what I want. Moreover, the result from the "find"command should be split into an arry to be processed later with a script.
command I am using to find the directory:
find path -maxdepth 2 -type d -name "*abc*"
Thanks in advance, Pedro