GitHub user Ben-Zvi opened a pull request: https://github.com/apache/drill/pull/623
Added -P to CD handle symbolic links in PWD The use of plain "cd" with a symbolic link to a directory maintains the logical name (i.e., includes the link's name), hence in a script, when a path is set using "pwd", that path includes the link instead of the full physical path. This is a problem when the path is used (e.g in "cd .." -- which ends in the wrong place !!) Adding the "-P" option makes "cd" follow the physical name. For example: [mapr@mfs91 ~]$ ls -l ~/drill/bin lrwxrwxrwx 1 mapr mapr 79 Oct 18 16:55 /home/mapr/drill/bin -> distribution/target/apache-drill-1.9.0-SNAPSHOT/apache-drill-1.9.0-SNAPSHOT/bin [mapr@mfs91 ~]$ cd ~/drill/bin ; pwd /home/mapr/drill/bin [mapr@mfs91 bin]$ cd -P ~/drill/bin ; pwd /home/mapr/drill/distribution/target/apache-drill-1.9.0-SNAPSHOT/apache-drill-1.9.0-SNAPSHOT/bin @paul-rogers please review You can merge this pull request into a Git repository by running: $ git pull https://github.com/Ben-Zvi/drill DRILL-4921 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/drill/pull/623.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #623 ---- commit aff976385b8cb5d6906f75eeeed7578c10ddbebb Author: Boaz Ben-Zvi <b...@mapr.com> Date: 2016-10-18T23:01:11Z Added -P to handle symbolic links ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---