Created
April 4, 2023 00:28
-
-
Save Sanix-Darker/5166519cbca0052dac03b25efa221255 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
#!/bin/bash | |
# run a command again and again only if the standard output hash change by a single bit | |
# _inf git status | |
_inf(){ | |
echo "Executing '$@' until the output change or you quit:" | |
# we source our alias first | |
PREVIOUS_HASH="" | |
while true; do | |
CURRENT_HASH=$($(echo "${@}") | md5sum) | |
if [ "$CURRENT_HASH" != "$PREVIOUS_HASH" ]; then | |
$(echo "${@}"); | |
echo -e "----------------------------------"; | |
PREVIOUS_HASH=$CURRENT_HASH | |
sleep 1; | |
fi; | |
sleep 0.5; # to keep our cpu sane | |
done; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment