On Sun, Aug 27, 2017 at 06:58:19AM -0700, Kaz Kylheku (Coreutils) wrote:
> On 26.08.2017 11:10, Colin Watson wrote:
> > I would like there to be an adverbial version of "cd", which takes a
> > path followed by a command and optional arguments and executes the
> > command with its working directory set to the given path. Its
> > invocation would be similar to chroot(8), that is:
> >
> > chdir [OPTION] NEWDIR [COMMAND [ARG]...]
>
> Could be an option in "env".
>
> env -C /path/to/dir VAR=value ... command arg
>
> (-C follows "tar -C' and "make -C").
Yep, PƔdraig made a similar suggestion in
https://lists.gnu.org/archive/html/coreutils/2017-08/msg00055.html and
the second patch I attached to
https://lists.gnu.org/archive/html/coreutils/2017-08/msg00058.html
implements it.
I intentionally didn't add a short option, though, because env(1) is a
standardised utility with multiple implementations and I didn't want to
risk colliding with somebody else's extension.
--
Colin Watson [address@hidden]