title: Linux parents parent path to file
body: <p>Possibly this question seems stupid but anyway. I have a script file <code>/local/bin/app1/script.sh</code> and I need to know its parents parent directory name <code>bin</code>. I know that I can use <code>${0%/*}</code> to determine the parent directory name. I'm not familiar with bash so could somebody please help me to figure out parents parent directory name? Many thanks.</p>