#!/bin/bash

var=$1
echo "variable: $var"

if [ ${var##*.} = "gz" ]
then 
   echo archive gz;
   gzunpack ${var};

elif [ ${var##*.} = "zip" ]
then
   echo archive zip;
   pkunzip ${var};

elif [[ $var =~ ^-?[0-9]+$ ]] && [[ $(( var + 3 )) -eq 5 ]] 
then
   echo "La summe est 5";

elif [[ -f $var && !($var =~ ^-?[0-9]+$) ]]
then 
   echo "Le fichier $var n'existe pas";

else
   echo archive non reconnue;
fi

