I have few repositories and each have config.php file that contain information about database like password. I have script that connect to database using stuff from that file and need to search back in directory tree so I can call it in every nested directory.
[ -e config.php ] && $(php -r 'require("config.php"); echo "mysql -u".$config["db_user"] . " -p".$config["db_pass"] . " " . $config["db_name"];')
What is easiest way to search back in directory tree using Bash?
This chops off a directory from the end of
PWDuntil it becomes empty. Some care may need to be taken in the presence of links.