[TUHS] Shell control through external commands

Joerg Schilling schily at schily.net
Sat Sep 10 19:41:06 AEST 2016


Michael Kjörling <michael at kjorling.se> wrote:

> On 10 Sep 2016 09:45 +0200, from dnied at tiscali.it (Dario Niedermann):
> > Il 15/07/2016 alle 14:27, Norman Wilson ha scritto:
> >> lu$ cat /bin/cd
> >> #!/bin/sh
> >> builtin cd "$@"
> >> lu$ 
> > 
> > But doesn't this change the current dir only in the child shell?
> > Which then exits right after the second line, parent shell's $PWD
> > unaffected. I really don't see how this script is useful.
>
> It does appear rather useless. Curiously, Debian (checked on Wheezy =
> bash 4.2+dfsg-0.1+deb7u3 and Jessie = bash 4.3-11+b1) seems to not
> supply anything like that, so it would appear to be some kind of
> Fedora-ism rather than a part of anything upstream; that, or the
> Debian folks are actually paying attention to what they ship onto
> users' systems.

POSIX requires some commands to be callable via exec().

Jörg

-- 
 EMail:joerg at schily.net                  (home) Jörg Schilling D-13353 Berlin
       joerg.schilling at fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/'



More information about the TUHS mailing list