Last active
March 30, 2021 14:21
-
-
Save hogashi/794e903a849128fda89b069d52707e50 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
cat ~/.bash_history | \ | |
tr -d '\r' | \ | |
perl -pe ' | |
chomp; | |
s/\\/\\\\/g; | |
s/"/\\"/g; | |
$_ = qq({\n "length": ) . length($_) . qq(,\n "command": ") . $_ . qq("\n}, ); | |
' | \ | |
perl -pe 's/, $//' | \ | |
awk ' | |
BEGIN { print "[" } | |
{ print " " $0 } | |
END { print "]"} | |
' > command-length.json |
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
[ | |
{ | |
"length": 62, | |
"command": "git branch -d $(git branch -vv | grep gone | awk '{print $1}')" | |
}, { | |
"length": 79, | |
"command": "git branch -d $(git branch -vv | grep gone | awk '{ print $1 }' | tr '\\n' ' ')" | |
}, { | |
"length": 104, | |
"command": "git branch -d $(git branch -vv | grep -v 'origin/' | git branch -vv | awk '{ print $1 }' | tr '\\n' ' ')" | |
}, { | |
"length": 72, | |
"command": "git branch -d $(git branch -vv | grep -v 'origin/' | awk '{ print $1 }')" | |
}, { | |
"length": 69, | |
"command": "git branch -d $(git branch -vv | grep ': gone]' | awk '{ print $1 }')" | |
}, { | |
"length": 79, | |
"command": "git branch -D $(git branch -vv | grep gone | awk '{ print $1 }' | tr '\\n' ' ')" | |
}, { | |
"length": 79, | |
"command": "gir branch -d $(git branch -vv | grep gone | awk '{ print $1 }' | tr '\\n' ' ')" | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment