#!/bin/bash# This is a very basic zenity script which is designed to take a file from a selection window# then take in the size of the parts that the file is to be split into# finally rar-ing up the file into the chunks selected.## Created by Andrew WalshDIR="" #set the directory variableDIR=`zenity --file-selection` #lets get the file/folderif [ -z "$DIR" ]; then #if directory is empty, display errorzenity --error --text="You must select a file" #error out and exitelse #the directory is not emptyCHUNK="" #set the chunk variableCHUNK=`zenity --text="Rar file size (kb):" --title="Rar file size" --entry` #get the size of the rar filesif [ -z $CHUNK ]; then #if the chunk size is empty display errorzenity --error --text="You must enter a chunk size" #error out and exitelse #the chunk size is not emptyrar a -v${CHUNK}k "${DIR}.rar" "$DIR" | tee >(zenity --progress --auto-kill --auto-close) >/dev/null #do the raringfi #end if for directoryfi #end if for chunk size