Skip to content

Commit 9b36fb7

Browse files
committed
Some commands for ezk.bash
1 parent daf6488 commit 9b36fb7

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

EasyKey.bash/.ezk-bash-config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
mavenhome=~/.m2
33
workspace=~/workspace
44
easykey=~/workspace/EasyKey.shellmenu
5-
kihon=~/kihon
5+
kihon=~/kihon
6+
sublime=/Users/d6t6/Library/Application Support/Sublime Text/Packages/User

EasyKey.bash/bashstuff.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@ source "$script_dir/../shellmenu.sh"
1010
findText(){
1111
echo "Text pattern:"
1212
read textPattern
13+
[ "$textPattern" = "" ] && waitonexit && return
1314
echo "File pattern:"
1415
read filePattern
16+
[ "$filePattern" = "" ] && waitonexit && return
1517
find . -name "$filePattern" -exec grep -Hn "$textPattern" {} + | awk -F ":" '{printf "%-40s %s\n", $1, $2}'
1618
}
1719

1820
findFiles(){
1921
echo "File pattern:"
2022
read filePattern
23+
[ "$filePattern" = "" ] && waitonexit && return
2124
find . -name "$filePattern"
2225
}
2326

2427
findTextAll() {
2528
echo "Text pattern:"
2629
read textPattern
30+
[ "$textPattern" = "" ] && waitonexit && return
2731
find . -type f -exec grep -Hn "$textPattern" {} + | awk -F ":" '{printf "%-40s %-4s %s\n", $1, $2, $3}'
2832
}
2933

@@ -34,6 +38,16 @@ whichSoftware() {
3438
which -a $software
3539
}
3640

41+
filesDo() {
42+
echo "File pattern:"
43+
read filePattern
44+
[ "$filePattern" = "" ] && waitonexit && return
45+
echo "Bash execution one liner (file ref with '\$1'):"
46+
read cbash
47+
[ "$cbash" = "" ] && waitonexit && return
48+
find . -name "$filePattern" -type f -exec sh -c "$cbash" _ {} \;
49+
}
50+
3751
menuInit "EasyKey.bash"
3852
submenuHead "Usefull "
3953
menuItem f "Find files by pattern" findFiles
@@ -43,4 +57,5 @@ menuInit "EasyKey.bash"
4357
menuItem m "Largest files" "find . -type f -exec du -h {} + | sort -rh | head -n 10"
4458
menuItem n "Size of current directory" "du -sh ."
4559
menuItem w "Where is my software installed?" whichSoftware
60+
menuItem e "Find files and do something" filesDo
4661
startMenu "pwd"

EasyKey.git/ezk-git-giob.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ contCommit() {
2121
echo "Enter commit to display:"
2222
read cname
2323
[ "${cname}" = "" ] && waitonexit && return
24-
git cat-file -p $cname
24+
executCommand "git cat-file -p $cname"
2525
}
2626

2727
setActual
@@ -32,7 +32,7 @@ menuItem b "Current HEAD pointer" "git symbolic-ref HEAD"
3232
menuItem c "Inspect current tree object" "git cat-file -p ${actual}^{tree}"
3333
menuItem d "Inspect current commit object" "git cat-file -p ${actual}^{commit}"
3434
menuItem e "Show contents of commit object" contCommit
35-
menuItem e "All branches" allBranches
36-
menuItem f "All tags" allTags
35+
menuItem f "All branches" allBranches
36+
menuItem g "All tags" allTags
3737
startMenu "setActual"
3838
noterminate

0 commit comments

Comments
 (0)