Compare commits

..

2 Commits

Author SHA1 Message Date
Amber 68c6fe6acf command help 2020-11-19 12:35:11 +01:00
Amber b0d3274e5e commands help 2020-11-19 11:58:07 +01:00
1 changed files with 26 additions and 0 deletions

26
.bashrc
View File

@ -139,6 +139,16 @@ gitpush() {
}
swp() {
myhelp() {
echo 'This tool is usefull to remove .swp files'
echo 'Usage: swp [-d dir] [-noi]'
echo 'if you do not specify the directory in -d param, search starts from the current'
echo 'if you do not specify the -noi param files removing is interactive'
}
if [ "$1" == '-h' ]; then
myhelp
return 1
fi
cpath=.
interactive='-i'
while [ -n "$1" ]; do # while loop starts
@ -159,6 +169,17 @@ swp() {
}
purgefext() {
myhelp() {
echo 'This tool is usefull to remove specific files type'
echo 'Usage: purgefext -e ext [-d dir] [-noi]'
echo 'the e param is mandatory: is the files extension you want to remove'
echo 'if you do not specify the directory in -d param, search starts from the current'
echo 'if you do not specify the -noi param files removing is interactive'
}
if [ "$1" == '-h' ]; then
myhelp
return 1
fi
cpath=.
interactive='-i'
ext=''
@ -177,6 +198,11 @@ purgefext() {
esac
shift #shift params
done
if [ "$ext" == '' ]; then
myhelp
return 1
fi
find $cpath -name "*."$ext -exec rm $interactive {} \;
}