GitHub

Folders and files

NameName

Last commit message

Last commit date

Latest commit

History

17 Commits

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

Read the original on github.com ↗