Skip to content

claui/submagic

Repository files navigation

Submagic

A tiny utility that redirects stdin into a temporary file and then prints the full path to that file.

Why do I need this?

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.

Installation

Installing manually

Clone this repository to any directory you like.

Installing from the AUR

Direct your favorite AUR helper to the submagic package.

Usage

See USAGE.md for details.

Contributing to Submagic

See CONTRIBUTING.md.

Credits

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.

License

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.

About

Writes stdin into a temp file and then prints the file name

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages