Created
August 27, 2017 05:52
-
-
Save mnathani/557f6aac04ae7f7106b8d5297ea7b150 to your computer and use it in GitHub Desktop.
Parallel not working
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 | |
res1=$(date +%s.%N) | |
OUTPUT="$(dig "$1")" & | |
WHOIS="$(whois "$1")" & | |
wait | |
echo "<pre>" | |
echo "$OUTPUT" | |
echo "</pre>" | |
echo "<h2>Whois Output for" $1 "</h2>" | |
echo "<pre>" | |
echo "$WHOIS" | |
echo "</pre>" | |
res2=$(date +%s.%N) | |
dt=$(echo "$res2 - $res1" | bc) | |
dd=$(echo "$dt/86400" | bc) | |
dt2=$(echo "$dt-86400*$dd" | bc) | |
dh=$(echo "$dt2/3600" | bc) | |
dt3=$(echo "$dt2-3600*$dh" | bc) | |
dm=$(echo "$dt3/60" | bc) | |
ds=$(echo "$dt3-60*$dm" | bc) | |
printf "Total runtime: %d:%02d:%02d:%02.4f\n" $dd $dh $dm $ds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment