clean up basic loading
parent
39d6cc755e
commit
d77c046c0b
|
@ -42,45 +42,11 @@ function alias_list() {
|
||||||
echo -e "\033[0m"
|
echo -e "\033[0m"
|
||||||
}
|
}
|
||||||
|
|
||||||
rsynchc() { rsync --help | grep "\-$1"; }
|
|
||||||
alias rsynch="rsynchc"
|
|
||||||
|
|
||||||
get_shopt () {
|
get_shopt () {
|
||||||
echo $([ "$(shopt -p $1 | grep '\-s')" ] && echo on || echo off)
|
echo $([ "$(shopt -p $1 | grep '\-s')" ] && echo on || echo off)
|
||||||
}
|
}
|
||||||
|
|
||||||
change-ext() {
|
|
||||||
local depth
|
|
||||||
local d
|
|
||||||
d=${3:-0}
|
|
||||||
let d+=1
|
|
||||||
[ $d -lt 1 ] && depth="" || depth=" -maxdepth $d "
|
|
||||||
find . $depth -name '*.'$1 -exec rename -n 's/\.'$1'/.'$2'/' \{} \;
|
|
||||||
read -p "do REALLY want to change the extensions? " -n 1 -r
|
|
||||||
echo
|
|
||||||
[[ ! $REPLY =~ ^[Yy]$ ]] && return 1
|
|
||||||
find . $depth -name '*.'$1 -exec rename 's/\.'$1'/.'$2'/' \{} \;
|
|
||||||
}
|
|
||||||
|
|
||||||
alias chext=change-ext
|
|
||||||
|
|
||||||
# find in any file
|
|
||||||
fif() {
|
|
||||||
grep -rnswl $1 -e $2 | more
|
|
||||||
}
|
|
||||||
|
|
||||||
# edit files
|
# edit files
|
||||||
# echo set the system editor using EDITOR environment variable
|
# echo set the system editor using EDITOR environment variable
|
||||||
edit() { ${EDITOR:-nano} $@; }
|
edit() { ${EDITOR:-nano} $@; }
|
||||||
gedit() { ${GEDITOR:-xed} $@; }
|
gedit() { ${GEDITOR:-xed} $@; }
|
||||||
|
|
||||||
|
|
||||||
add-repo-key () {
|
|
||||||
gpg --keyserver keyserver.ubuntu.com --recv-key $1
|
|
||||||
gpg -a --export $1 | sudo apt-key add -
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
alias ssudo="ssudo "
|
|
|
@ -12,6 +12,9 @@ isDir() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rsynchc() { rsync --help | grep "\-$1"; }
|
||||||
|
alias rsynch="rsynchc"
|
||||||
|
|
||||||
function dir_copy () {
|
function dir_copy () {
|
||||||
|
|
||||||
[[ ! $(command -v rsync) ]] && { echo rsync must be installed to use this function; return 5; }
|
[[ ! $(command -v rsync) ]] && { echo rsync must be installed to use this function; return 5; }
|
||||||
|
|
|
@ -14,6 +14,11 @@ isFile() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# find in any file
|
||||||
|
fif() {
|
||||||
|
grep -rnswl $1 -e $2 | more
|
||||||
|
}
|
||||||
|
|
||||||
build_file () {
|
build_file () {
|
||||||
# local file
|
# local file
|
||||||
# echo build file $1 $2
|
# echo build file $1 $2
|
||||||
|
@ -272,3 +277,19 @@ if [ -v PS1 ]; then
|
||||||
alias dfind="_find -t d -d 0 -n "
|
alias dfind="_find -t d -d 0 -n "
|
||||||
alias sdfind="_find -s -t d -d 0 -n "
|
alias sdfind="_find -s -t d -d 0 -n "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
change-ext() {
|
||||||
|
local depth
|
||||||
|
local d
|
||||||
|
d=${3:-0}
|
||||||
|
let d+=1
|
||||||
|
[ $d -lt 1 ] && depth="" || depth=" -maxdepth $d "
|
||||||
|
find . $depth -name '*.'$1 -exec rename -n 's/\.'$1'/.'$2'/' \{} \;
|
||||||
|
read -p "do REALLY want to change the extensions? " -n 1 -r
|
||||||
|
echo
|
||||||
|
[[ ! $REPLY =~ ^[Yy]$ ]] && return 1
|
||||||
|
find . $depth -name '*.'$1 -exec rename 's/\.'$1'/.'$2'/' \{} \;
|
||||||
|
}
|
||||||
|
|
||||||
|
alias chext=change-ext
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue