v3.0.1: many small improvement and bugfix
This commit is contained in:
@@ -255,7 +255,7 @@ taz ()
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
"-"[1..9])
|
"-"[1..9])
|
||||||
local complevel=${opt:1:1}
|
local complevel=$(echo $opt | sed 's/-//')
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"-"*)
|
"-"*)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function error ()
|
|||||||
{
|
{
|
||||||
local errcode=$?
|
local errcode=$?
|
||||||
backtrace
|
backtrace
|
||||||
exit $errcode
|
return $errcode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ settrace ()
|
|||||||
{
|
{
|
||||||
local status="off"
|
local status="off"
|
||||||
[[ $(trap -p ERR) ]] && status="on"
|
[[ $(trap -p ERR) ]] && status="on"
|
||||||
trap -p ERR
|
#trap -p ERR
|
||||||
for opt in $@ ; do
|
for opt in $@ ; do
|
||||||
case $opt in
|
case $opt in
|
||||||
"-h"|"--help")
|
"-h"|"--help")
|
||||||
|
|||||||
@@ -115,6 +115,9 @@ rmspc ()
|
|||||||
echo " -v, --verbose Display what is being done"
|
echo " -v, --verbose Display what is being done"
|
||||||
echo " -s, --shell Do nothing and display commands that would be executed"
|
echo " -s, --shell Do nothing and display commands that would be executed"
|
||||||
echo
|
echo
|
||||||
|
echo "Note: if the --subst-char option is given without parameters, spaces will be"
|
||||||
|
echo " replaced with nothing (concatenation)."
|
||||||
|
echo
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -123,7 +126,11 @@ rmspc ()
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
"-c"?*|"--subst-char"?*)
|
"-c"?*|"--subst-char"?*)
|
||||||
|
if [[ $(echo $opt | grep "=") ]]; then
|
||||||
local substchar=$(echo "$opt" | cut -f 2- -d '=')
|
local substchar=$(echo "$opt" | cut -f 2- -d '=')
|
||||||
|
else
|
||||||
|
local substchar='none'
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"-v"|"--verbose")
|
"-v"|"--verbose")
|
||||||
@@ -143,6 +150,7 @@ rmspc ()
|
|||||||
done
|
done
|
||||||
|
|
||||||
[[ ! $substchar ]] && substchar="_"
|
[[ ! $substchar ]] && substchar="_"
|
||||||
|
[[ $substchar == "none" ]] && local substchar=""
|
||||||
[[ $verb ]] && local mvopt="-v"
|
[[ $verb ]] && local mvopt="-v"
|
||||||
|
|
||||||
for f in *; do
|
for f in *; do
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ dpkgs Search for the given package in the installed ones
|
|||||||
gpid Give the list of PIDs for the given process name
|
gpid Give the list of PIDs for the given process name
|
||||||
isipv4 Tell if the given IPv4 is valid
|
isipv4 Tell if the given IPv4 is valid
|
||||||
isipv6 Tell if the given IPv6 is valid
|
isipv6 Tell if the given IPv6 is valid
|
||||||
|
ku Kill process owned by users in parameter
|
||||||
mcd Create a directory and go inside
|
mcd Create a directory and go inside
|
||||||
meteo Display curent weather forecast for the configured city
|
meteo Display curent weather forecast for the configured city
|
||||||
ppg Display process matching the given parameter
|
ppg Display process matching the given parameter
|
||||||
@@ -25,6 +26,7 @@ taz Compress smartly the given files or directory
|
|||||||
utaz Uncompress all zip files in the given (or current) directory
|
utaz Uncompress all zip files in the given (or current) directory
|
||||||
ver Display version of your copy of profile
|
ver Display version of your copy of profile
|
||||||
|
|
||||||
|
Please use <command> --help to obtain usage details.
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
export -f help
|
export -f help
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ meteo ()
|
|||||||
[[ $# -eq 0 ]] && local cities=$DEFAULT_CITY
|
[[ $# -eq 0 ]] && local cities=$DEFAULT_CITY
|
||||||
|
|
||||||
for city in $cities; do
|
for city in $cities; do
|
||||||
curl https://wttr.in/$city
|
curl https://wttr.in/$city || echo "Failed fetching datas for $city."
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
export -f meteo
|
export -f meteo
|
||||||
@@ -30,7 +30,10 @@ showinfo()
|
|||||||
{
|
{
|
||||||
echo -e "\n"
|
echo -e "\n"
|
||||||
if command -v figlet >/dev/null 2>&1; then
|
if command -v figlet >/dev/null 2>&1; then
|
||||||
figlet -k $(hostname)
|
if [[ -s /usr/share/figlet/ansi_shadow.flf ]]; then
|
||||||
|
local figopt="-f ansi_shadow"
|
||||||
|
fi
|
||||||
|
figlet -k $(hostname) $figopt
|
||||||
else
|
else
|
||||||
echo "$(hostname -f)"
|
echo "$(hostname -f)"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
# 19/07/2022 v2.8.1 : few cleanup, fixes and optimizations
|
# 19/07/2022 v2.8.1 : few cleanup, fixes and optimizations
|
||||||
# 29/07/2022 v2.8.2 : added warning for non bash users
|
# 29/07/2022 v2.8.2 : added warning for non bash users
|
||||||
# 27/08/2022 v3.0.0 : splitted everything, added rain screensaver
|
# 27/08/2022 v3.0.0 : splitted everything, added rain screensaver
|
||||||
|
# 07/11/2022 v3.0.1 : added concatenation to rmspc, added ku, error managed in meteo
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Copyright (c) 2013-2022 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
|
# Copyright (c) 2013-2022 Geoffray Levasseur <fatalerrors@geoffray-levasseur.org>
|
||||||
# Protected by the BSD3 license. Please read bellow for details.
|
# Protected by the BSD3 license. Please read bellow for details.
|
||||||
@@ -68,7 +69,7 @@
|
|||||||
# * OF SUCH DAMAGE.
|
# * OF SUCH DAMAGE.
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
export PROFVERSION="3.0.0"
|
export PROFVERSION="3.0.1"
|
||||||
|
|
||||||
export DEFAULT_CITY="Toulouse"
|
export DEFAULT_CITY="Toulouse"
|
||||||
|
|
||||||
@@ -200,4 +201,5 @@ fi
|
|||||||
unset pathremove pathprepend pathappend
|
unset pathremove pathprepend pathappend
|
||||||
|
|
||||||
#return 0
|
#return 0
|
||||||
# End /etc/profile
|
|
||||||
|
# End profile.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user