Fix hist function on Windows
This commit is contained in:
parent
54c13ffc87
commit
1a494c6c38
10
functions
10
functions
|
@ -57,7 +57,7 @@ function git-on-master {
|
||||||
git checkout master && git pull --rebase
|
git checkout master && git pull --rebase
|
||||||
git checkout $branch
|
git checkout $branch
|
||||||
git rebase master
|
git rebase master
|
||||||
}
|
}
|
||||||
|
|
||||||
function take {
|
function take {
|
||||||
mkdir $1
|
mkdir $1
|
||||||
|
@ -84,5 +84,11 @@ function chrome () {
|
||||||
|
|
||||||
# See top 10 bash commands
|
# See top 10 bash commands
|
||||||
function hist() {
|
function hist() {
|
||||||
cat ~/.history|cut -d ';' -f 2- 2>/dev/null| awk '{a[$1]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
|
if [[ "${platform,,}" == *'ming'* ]]; then
|
||||||
|
hist_file=~/.bash_history
|
||||||
|
else
|
||||||
|
hist_file=~/.history
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat $hist_file|cut -d ';' -f 2- 2>/dev/null| awk '{a[$1]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user