Run a command with relative path from symlink directory

I’ve got a directory structure like this:

build -> vendor/drupal/core

So as you see, build is a symlink to the core directory.
drush is an executable file. I need to be able to cd into build and call drush from there.

But if I do this:

cd build

This doesn’t work, because .. points to vendor/drupal directory, because when I cd into build, it in fact goes to vendor/drupal/core, of course.

I know I can call it this way: ../../../bin/drush, but is there some kind of workaround to make .. point to the root, not the actual parent?

Source: unix

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.