execline
Software
skarnet.org
The getcwd program
getcwd stores its current working directory
into a given environment variable,
then executes a program.
Interface
getcwd [ -E | -e ] var prog...
getcwd stores a fully resolved absolute path (i.e. without any
.. or symbolic link components) to its current working directory
into the var variable, then
execs into prog with its arguments.
Options
- -e : no autoimport. This is the default.
- -E : autoimport. Instead of exec'ing into
prog..., exec into importas -ui var var
prog.... This substitutes var into the command
line instead of putting it into the environment.
Notes
- var must be given without a dollar!
- var must not contain =.
- Unlike the
pwd
POSIX command, getcwd does not depend on the PWD environment
variable and will exhibit a consistent behaviour no matter the environment.