On Thu, Oct 19, 2017 at 05:14:49PM -0600, Grant Taylor via TUHS wrote:
On 10/19/2017 05:00 PM, Dave Horsfall wrote:
Good luck with "cd"...
There's nothing that states that the executable effectively do anything.
It's still useful. Minimal example:
[khm@pc ~]$ (exec cd /); echo $?
0
[khm@pc ~]$ (exec cd /nosuchpath); echo $?
/usr/bin/cd: line 2: cd: /nosuchpath: No such file or directory
1
You can use this to dodge some of the crappier shells' problems,
sometimes, or to test for directory accessibility in a clean
environment. I've run across it in the wild on occasion, even if I
don't really play this sort of game myself.
khm