#!/bin/bash folder="$(kdialog --getexistingdirectory ~)" count="$(find "$folder" -mindepth 1 | wc -l)" percentage="$(echo 100 $count | awk '{print $1/$2}')" echo "$percentage" files="$(find "$folder" -mindepth 1)" ( files="$(find "$folder" -mindepth 1)" echo "$percentage" for lfile in $files do name="$(basename $lfile)" echo "# Sichere $name" ; echo $lfile >> ~/filelist && sleep 0.05 echo "$percentage" percentage="$(echo $percentage | awk '{print $1+$1}')" done echo "100" echo "# Das Image wurde erfolgreich erstellt" ) | zenity --progress \ --title="Einen Ordner sichern" \ --text="Erstelle Datei-Liste" \ --percentage=0 if [ "$?" = -1 ] ; then zenity --error \ --text="Update canceled." fi