I want to assign a part of my current working directory path name to a variable and use it in a script inside the directory itself.
If my pwd is :
/home/desktop/project/ABC/abc/abc_123, is there a command to assign ABC to a variable, say $PROJECT_NAME?
I tried dirname, but it seems to be returning '.' for input 'pwd', and anyway I need one more step behind than what dirname can supposedly return.