A command for running a command within another directory or directories matching a glob pattern.
It will also create the directories, if missing. If the top level directory is empty after executing the command, it will be removed. This means that in testdirectory pwd leaves no traces. When running in multiple directories, it will not create any new directories.
in build cmake ..
Instead of:
mkdir -p build
cd build
cmake ..
in project ./configure --prefix=/usr
Instead of:
cd project
./configure --prefix=/usr
cd ..
Or:
(cd project; ./configure --prefix=/usr)
Or:
pushd project
./configure --prefix=/usr
popd
Support for globs via filepath.Glob which allows you to do something like (note the quotes which prevent a shell like bash from handling the globbing itself):
in "./**/*pom.xml" mvn clean
Either download the binary release (for 64-bit Linux), or install the development version (using go install like this requires Go 1.19 or later):
go install github.com/xyproto/in@latest
Manual installation, using git, go, sudo and install:
git clone https://github.com/xyproto/in
cd in
go build
sudo install -Dm755 in /usr/bin/in
- Go 1.19 or later
When compiling with GCC 10.2.0 (gccgo), the in executable is only 41k here.
- Version: 1.5.0
- License: BSD-3
- Author: Alexander F. Rødseth <[email protected]>