-
Notifications
You must be signed in to change notification settings - Fork 0
/
.functions
38 lines (32 loc) · 1009 Bytes
/
.functions
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
extract () {
if [ -f $1 ]; then
case $1 in
*.tar.gz) tar xvzf $1 ;;
*.tar.bz2) tar xvjf $1 ;;
*.rar) rar x $1 ;;
*.bz2) bunzip2 -d $1 ;;
*.zip) unzip $1 ;;
*.7z) 7z x $1 ;;
*) echo "Ist jetzt Katze! o.0"
esac
else
echo "File: '$1', not found."
fi
}
mktar() { tar cvf "${1%%/}.tar" "${1%%/}/"; }
mktgz() { tar cvzf "${1%%/}.tar.gz" "${1%%/}/"; }
mktar() { tar cvjf "${1%%/}.tar.bz2" "${1%%/}/"; }
po () {
popd "$@"
dirs -v
}
virtualenv_info () { [ $VIRTUAL_ENV ] && echo "($(basename $VIRTUAL_ENV))"; }
compare () {
src=$1
dst=$2
if [ ! -e "$src" ] || [ ! -e $dst ];then
echo "src or dst dir does not exist"
return
fi
find $src -type f -exec basename {} \; | awk -v dst="$dst" '{print dst"/"$1}' | xargs -n1 | while read file;do test -f $file && { echo "$file,true"; } || { echo "$file,false"; }; done
}