I have the following 2 paths:
Case 1: /home/user/phase/dir1/log/Illinois/
Case 2:/home/user/phase/dir02/log/
In both the cases above I want to strip/chop off everything starting from log/ directory to the end and would want to end up with either:
Case 1:/home/user/phase/dir1/
or
Case 2:/home/user/phase/dir02/
How can I achieve this?
Thanks.