Created
March 9, 2020 12:53
-
-
Save faizzed/20563d5144b82d9ec33617c8124a2d9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ "$1" == "" ]; then | |
printf "First argument should be filename.." | |
exit | |
fi | |
file="$1" | |
### Set initial time of file | |
LTIME=`stat -c %Z "$file"` | |
while true | |
do | |
ATIME=`stat -c %Z "$file"` | |
if [[ "$ATIME" != "$LTIME" ]] | |
then | |
go run "$file"; | |
printf "===============================\n" | |
LTIME=$ATIME | |
fi | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment