Hi,
From below directories path I need the directory which comes immediately after the "DataPath"
/var/errors/LogDefaultPath/DataPath/Data01/Data02 (Directory name "Data01" is the result from this path)
/var/errors/LogDefaultPath/DataPath/Log01/Log0202 (Directory name "Log01" is the result from this path)
/var/errors/LogDefaultPath/DataPath/Planning (Directory name "Planning" is the result from this path)
/var/errors/LogDefaultPath/DataPath/Support (Directory name "Support" is the result from this path)
/var/errors/LogDefaultPath/DataPath/Support/Contents (Directory name "Support" is the result from this path)
Basically I am storing the current directory path
as
_C_CDIR=$PWD
which gives me the complete path
/var/errors/LogDefaultPath/DataPath/Data01/Data02
Now If my path contains "DataPath" I need to store the immediate directory name "Data01" into some variable and append this to another variable and use that variable at later stage in script.
Likewise I need to do for all the directory paths ... find ONLY immediate directory name after "DataPath"