A tiny utility that redirects stdin into a temporary file and then prints the full path to that file.
It helps you in situations where you’d like to feed the output of a
program foo
into another program bar
, but bar
only accepts a
file name as an argument and refuses to work with standard input or
Bash’s process substitution.
In other words, submagic
allows you to run a shell command line like:
foo | submagic | xargs bar
if foo
emits standard output but bar
only accepts files.
This is the solution for the question Creating a temporary file from standard input on Unix Stack Exchange.
For practical usage examples, see
USAGE.md
.
Clone this repository to any directory you like.
Direct your favorite
AUR helper to the
submagic
package.
See USAGE.md
for details.
See CONTRIBUTING.md
.
Credits go to user k.stm – the author of the original submagic
question – and to numerous
other users who came up with a solution for it.
Copyright (c) 2024 Claudia Pellegrino
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. For a copy of the License, see LICENSE.