Skip to content

Continously run shell commands and watch output for changes

Notifications You must be signed in to change notification settings

cdfuller/command-watcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

command-watcher

A script for continously running a shell command and printing the output when it's changed

Usage

$ ./command_watcher.py --help
usage: command-watcher [-h] [-i INTERVAL] command

positional arguments:
  command               the command to run

optional arguments:
  -h, --help            show this help message and exit
  -i INTERVAL, --interval INTERVAL
                        interval in seconds to run the command, default: 2.5

Examples

  • Running a sql command every 10 seconds
$ ./command_watcher.py -i 10 psql -d db-name -c 'SELECT COUNT(*) FROM "users";'

TODO

  • Add alias support by adding shell support to subprocess.run
    • Do I need to check to see which shell the user is currently using?

About

Continously run shell commands and watch output for changes

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages