Restart a command on STDIN activity
Haskell Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
System
.gitignore
Conscript.cabal
Conscript.hs
LICENSE
README.md
Setup.hs
foo.sh

README.md

Conscript

Run a command and restart it on each new line of STDIN.

Conscript Command Restarter

Usage

conscript command [args*]

Examples

Use like 'watch':

while true; do echo lol ; sleep 1; done | conscript ls

Which is equivalent to the xargs command:

while true; do echo lol ; sleep 1; done | xargs -L 1 -I % ls

Where Conscript differs from xargs is that if the script is a long-running process, then subsequent incoming lines will kill that process and restart it, rather than wait for it to finish.

Useful in conjunction with Commando:

commando -c echo | grep --line-buffered Add  | conscript ls

Another example - Watch updates to a file:

commando | conscript bash -c "clear && less file.txt"

Binaries