This is only a little piece of code... but the terminal give me an error "syntax error near token not expected "archive" ".
The functions in bash do not accept parameters like function fun (hello) {
function extractProcess (archive){
mv $archive $WORK_DIR
pathFile=${archive%/*} #Path input archive
nameFile=$(ls $WORK_DIR)
name=${archive%.*} #nameFile without exteension
case $nameFile in
*.tar.bz) tar xjf "$WORK_DIR/$nameFile" -C $WORK_DIR ;;
*.tar.bz2) tar xjf "$WORK_DIR/$nameFile" -C $WORK_DIR ;;
*.tar.gz) tar xzf "$WORK_DIR/$nameFile" -C $WORK_DIR ;;
*.bz) bunzip2 "$WORK_DIR/$nameFile" ;;
*.bz2) bunzip2 "$WORK_DIR/$nameFile" ;;
*.gz) gunzip -Ndk "$WORK_DIR/$nameFile" ;;
*.tar) tar xf "$WORK_DIR/$nameFile" -C $WORK_DIR ;;
*.tbz) tar xjf "$WORK_DIR/$nameFile" -C $WORK_DIR ;;
*.tbz2) tar xjf "$WORK_DIR/$nameFile" -C $WORK_DIR ;;
*.tgz) tar xzf "$WORK_DIR/$nameFile" -C $WORK_DIR ;;
*.zip) unzip -qq "$WORK_DIR/$nameFile" -d $WORK_DIR ;;
esac