In a given shell script I need to take a known path and check it upwards (to the file system root) for correct permissions. How would I split the path and walk upwards in a shell script (can be bash or a "lower common denominator")?
|
feedback
|
|
This should work:
| ||||
|
feedback
|
|
When I tried ennuikiller's awk solution, it missed the current directory for me. So, while a bit late, here's a bash-only solution:
Don't know if it's the most elegant solution, but it works. I found a simple explanation of the string manipulation on tldp and wrapped a loop around it. | |||
|
feedback
|
