Skip to content

Instantly share code, notes, and snippets.

@shawalli
shawalli / watch
Last active September 14, 2018 14:52 — forked from flagranterror/gist:3852795
'Watch' command as a bash script.
#!/bin/bash
# This script *should* work on *nix and Windows, but was designed specifically for git-bash on Windows, to fill the watch gap.
clear
if [ "$#" -gt "2" ] && [ "-n" == "${1:0:2}" ]; then
time=$(echo $1 | sed -e 's/-n//')
shift
watchedcmd=$@
else
time="5" # Saneish default