Code: Select all
if $1 | grep zip; then unzip; fi
if $1 | grep rar; then "unrar e"; fi
Code: Select all
if $1 | grep zip; then unzip; fi
if $1 | grep rar; then "unrar e"; fi

Code: Select all
case "$1" in
*.zip )
unzip "$1" ;;
*.rar )
unrar e "$1" ;;
esacCode: Select all
if [[ $1 == *zip ]]
then unzip $1
elif [[ $1 == *rar ]]
then rar e $1
fi