fdcreate/README.md
2022-08-11 13:58:15 +02:00

31 lines
586 B
Markdown

# fdcreate
create an anonymous file, then execute a program
### usage
```
fdcreate name prog...
```
### description
fdcreate creates an anonymous file (memfd) with memfd_create(3) and
exports the resulting file descriptor as name, then exec(3)s into prog
with its arguments.
### examples
```
fdcreate tmate
importas -ui tmate_fd tmate
foreground {
pipeline {
curl -L https://github.com/tmate-io/tmate/releases/download/2.4.0/tmate-2.4.0-static-linux-amd64.tar.xz
}
fdmove -c 1 $tmate_fd
tar xOJf - tmate-2.4.0-static-linux-amd64/tmate
}
/proc/self/fd/$tmate_fd
```