Last active
August 29, 2015 14:01
-
-
Save starkers/32843075e5429d4fb370 to your computer and use it in GitHub Desktop.
Looping command doorman - I use this "doorman" to comapre output of two slightly different commands
This file contains hidden or 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 | |
# This script loops forever and waits for a standard STDIN for each loop. | |
# | |
# When you hit [RETURN] it pipes you're input into the command you launched the script with | |
# | |
# For example.. If I want to compare public DNS records (on 4.2.2.3 for example) with the | |
# records on my own DNS server.. EG: 1.2.3.4 I would split a terminator it two and run: | |
# Terminal 1: doorman dig @4.2.2.3 +short | |
# Terminal 2: doorman dig @1.2.3.4 +short | |
# | |
# I then join the terminals into the same group... | |
# type in the records you want to test... EG: MX somesite.org | |
# | |
while true; do | |
read input | |
$@ $input | |
sleep 0.5 | |
echo "[end: $?]" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment