Message288475
Thanks for the additional information!
> The 'cd' man page says that 'cd -P' should "perform actions equivalent to the chdir() function".
Just wondering, do you know what is the function called by `cd`/`cd -L` then? It doesn't seems to be a bash internal tweak because `/usr/bin/pwd -L` is able to get the symlink path, and this binary is not part of bash.
> You'll have to make a case for it being useful enough to add.
The use case is for shells written in Python, like for instance `xonsh` [1,2]. Being powered by Python, the only way to change directory is by using `os.chdir()`. It is then not possible to mimic the bash `cd` function without using workarounds, like for instance storing the symlink path in a variable, and even this doesn't allow to use `/usr/bin/pwd -L` in scripts because it would always returns the physical location.
Having such described functions (yet to be named) would permit python shells to offer users differentiated `cd` and `cd -P` commands, as well as having `pwd -L` in scripts behaving the same than in traditional shells.
[1] http://xon.sh/
[2] https://github.com/xonsh/xonsh |
|
Date |
User |
Action |
Args |
2017-02-23 19:59:18 | StreakyCobra | set | recipients:
+ StreakyCobra, r.david.murray, serhiy.storchaka |
2017-02-23 19:59:18 | StreakyCobra | set | messageid: <1487879958.31.0.968292212813.issue29635@psf.upfronthosting.co.za> |
2017-02-23 19:59:18 | StreakyCobra | link | issue29635 messages |
2017-02-23 19:59:18 | StreakyCobra | create | |
|