Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ODP=0
- while true; do
- menu=("1. Nazwa pliku: $NAZWA" "2. Katalog: $KATALOG" "3. Rozmiar: $ROZMIAR" "4. Ilość dni od ostatniej modyfikacji: $DATAMOD" "5. Zawartosc: $ZAWART" "6. Szukaj" "7. Koniec")
- ODP=`zenity --list --column=Menu "${menu[@]}" --height 400`
- if [ "$ODP" = "1. Nazwa pliku: $NAZWA" ]; then
- NAZWA=`zenity --entry --title "Wpisz frazę" --text "$ODP"`
- elif [ "$ODP" = "2. Katalog: $KATALOG" ]; then
- KATALOG=`zenity --entry --title "Wpisz frazę" --text "$ODP"`
- elif [ "$ODP" = "3. Rozmiar: $ROZMIAR" ]; then
- ROZMIAR=`zenity --entry --title "Wpisz frazę" --text "$ODP"`
- elif [ "$ODP" = "4. Ilość dni od ostatniej modyfikacji: $DATAMOD" ]; then
- DATAMOD=`zenity --entry --title "Wpisz frazę" --text "$ODP"`
- DATAMODM=$((-DATAMOD))
- elif [ "$ODP" = "5. Zawartosc: $ZAWART" ]; then
- ZAWART=`zenity --entry --title "Wpisz frazę" --text "$ODP"`
- elif [ "$ODP" = "6. Szukaj" ] || [ "$ODP" = "7. Koniec" ]; then
- break
- fi
- done
- if [ "$ODP" = "6. Szukaj" ]; then
- ZNALEZIONE=$(find $KATALOG -name $NAZWA -size $ROZMIAR -mtime $DATAMOD -exec grep -c "$ZAWART" {} \;)
- if [ $ZNALEZIONE -gt 0 ]; then
- zenity --info --title "Wynik" --text "Istnieje taki plik."
- else
- zenity --info --title "Wynik" --text "Nie istnieje taki plik."
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement