execline
Software
skarnet.org
The posix-cd program
posix-cd changes the current working directory to a
given directory, then executes a program.
Interface
posix-cd dir prog...
posix-cd changes the current working directory to dir
according to the
POSIX
specification for a cd external utility. Then, if prog... is
not empty, it execs into it.
Notes
- posix-cd is only available when execline has been configured
with the --enable-pedantic-posix option, and in this case, the
cd binary is a symbolic link to it.
- posix-cd fully conforms to the
POSIX
specification. When prog... is not empty, the behaviour of a
cd utility is not specified by POSIX, so posix-cd extends
the spec to be actually useful and usable in an execline program with the same
interface as the regular execline cd command.
- Nobody ever executes or needs the external version (i.e. not a shell
builtin) of the POSIX cd command. Compared to the regular execline
cd, posix-cd is uselessly bloated and slow.
The only reason it exists is that some distributions refuse to package
execline correctly unless it is strictly POSIX-compliant; the
--enable-pedantic-posix configure option is there to appease them.