1
0
mirror of https://gitlab.com/JKANetwork/jka-toolkit.git synced 2026-02-20 12:01:31 +01:00

pruebas del todo...

This commit is contained in:
kprkpr
2016-06-22 23:24:23 +02:00
parent 72eb339b9d
commit ed65ffce37

View File

@@ -28,15 +28,15 @@ function sacaFormato() {
} }
#Function msg, print in stdout a final message #Function msg, print in stdout a final message
function msg() { function msg() {
local var=$1 local var="$1"
local var2=$2 local var2="$2"
printf -- "$(gettext "File/s %s has/have been compressed in %s")" $var $var2 printf -- "$(gettext "File/s %s has/have been compressed in %s")" "$var" "$var2"
echo echo
} }
#Function msg2, print in stdout a final message #Function msg2, print in stdout a final message
function msg2() { function msg2() {
local var=$1 local var="$1"
printf -- "$(gettext "File %s has been decompressed")" $var printf -- "$(gettext "File %s has been decompressed")" "$var"
echo echo
} }
@@ -119,23 +119,30 @@ elif [ "$1" = "-c" ];then
exit exit
fi fi
# TODO: Hacer que esto funcione # TODO: Hacer que esto funcione
# else ### Funcion nueva
# for i in $@ for compfile in "$@"; do
# do if [[ "$compfile" != "$1" && "$compfile" != "$2" ]];then
# if [[ "$i" != "$1" && "$i" != "$2" ]];then if [ ! -d "$compfile" -a ! -f "$compfile" ];then
# if [ ! -d "$i" -a ! -f "$i" ];then printf -- "$(gettext "%s no such file or directory")" "$compfile"
# printf -- "$(gettext "%s no such file or directory")" "$i" echo
# echo #exit
# exit fi
# fi fi
# fi done
# done ### Fin funcion nueva del tod
# fi #Funcion files nueva
files="$3" for compfile in "$@"; do
for (( i=4; i<=$#; i++)) if [[ "$compfile" != "$1" && "$compfile" != "$2" ]];then
do files="$files $compfile"
files="$files $(echo $* | cut -f$i -d" ")" fi
done done
#Fin funcion files nueva
## files anterior
# files="$3"
# for (( i=4; i<=$#; i++))
# do
# files="$files $(echo $* | cut -f$i -d" ")"
# done
sacaFormato "$salida" sacaFormato "$salida"
case $formato in case $formato in
"tar" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "tgz" | "tbz" | "txz" | "tlz") "tar" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "tgz" | "tbz" | "txz" | "tlz")