1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
# `pipectl` - a simple named pipe management utility
`pipectl` is a tool to create and manage short-lived named pipes that can be
used to e.g. control a longer-lived program using short commands from elsewhere
in the system without needing a complex IPC mechanism such as UNIX domain
sockets.
## Features
- Create a named pipe using `pipectl -o | long-running-program`
- Send something to that program's stdin using `echo "input line" | pipectl -i`
- Create multiple named pipes simultaneously by naming them with `--name` or `-n`
- Create a named pipe at a custom path by using `--path` or `-p`
- Cleans up after itself when the program exits and removes the pipe
- Allows synchronizing writes to the pipe with the `--lock` or `-l` option

## Usage
```
usage: pipectl [options]
options:
-h, --help show this help
-o, --out create a pipe and print its contents to stdout
-i, --in write stdin to an open pipe
-n, --name N use a pipe with a custom name instead of the default
-p, --path P use a custom path P for the pipe created by pipectl
-f, --force force create a pipe even if one already exists
-l, --lock use flock(2) to synchronize writes to the pipe
-v, --verbose print debug messages on stderr
```
## Environment Variables
`pipectl` will use the environment variables `XDG_RUNTIME_PATH` and `TMPDIR` to
discover the preferred directory for the named pipes created by it. If both are
unset, `pipectl` falls back to placing the pipe in `/tmp`.
## Installation
`pipectl` is already packaged in many distros and can be installed via the
package manager:
[](https://repology.org/project/pipectl/versions)
## Dependencies
- `CMake`
- `scdoc` (for man pages)
## Building
- Run `cmake -B build`
- Run `cmake --build build`
## Files
- `src/main.c`: the whole program
## License
This project is licensed under the GNU GPL version 3.0 or later (SPDX
[GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later.html)). The full
license text can also be found in the [LICENSE](/LICENSE) file.
|