Last active
November 3, 2020 00:17
-
-
Save bg002h/ce5f5e6a5432395f2d19a9f0d5bf819c to your computer and use it in GitHub Desktop.
Blockstream Satellite monitoring scripts
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
FileName: WhatHaveIGot | |
#!/bin/bash | |
cat $1 | grep -P "[0-9]{1,6}\) - G" -o | grep -P "[0-9]{1,6} -o | uniq | sort -g | |
FileName: MissingInSequence | |
#!/bin/bash | |
awk '{for(i=p+1; i<$1; i++) print i} {p=$i}' $1 | |
FileName: RangeMissingInSequence | |
#!/bin/bash | |
awk 'NR==1{first=$1; last=$1} $1==last+1{last=$1; next} first==last{print first; first=$1; last=first; next} {print first, last; first=$1; last=first} END{print first, last}' $1 | |
USAGE | |
WhatHaveIGot ./debug.log | MissingInSequence | RangeMissingInSequence | less |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment