-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshellConfig.sh
More file actions
38 lines (34 loc) · 817 Bytes
/
Copy pathshellConfig.sh
File metadata and controls
38 lines (34 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
alias cz="cat ~/.zshrc";
alias cb="cat ~/.bashrc";
alias e="exit";
alias sb="source ~/.bashrc";
alias sz="source ~/.zshrc";
alias v="vim";
alias hh='chflags hidden ~/Desktop/*'
alias h="history"
s(){
ssh zhengjun.du@$1;
}
g2(){egrep -r -i "`echo $@`" .}
updateGit(){
/bin/bash $HOME/MyScript/getFromGit.sh;
}
c(){
if [[ -z $1 || -z $2 ]]; then
echo "usage : c ord_string new_string ... " && return 1;
fi
lastCMD=`history|tail -n -1|awk '{ $1=""; print $0}'`;
while [[ condition ]]; do
#statements
done
firtWord=`echo $lastCMD|awk '{print $1}'`;
echo "firstWord $firstWord"
if [[ "$firstWord" == "c" ]]; then
$lastCMD=`history|tail -n -2|head -n -1|awk '{$1="";print $0}'`;
fi
echo $lastCMD |sed "s/$1/$2/" ;
newCMD=`echo $lastCMD |sed "s/$1/$2/"`;
echo $lastCMD;
eval "$newCMD";
ls;
}