#!/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 Walsh DIR="" #set the directory variable DIR=`zenity --file-selection` #lets get the file/folder if [ -z "$DIR" ]; then #if directory is empty, display error zenity --error --text="You must select a file" #error out and exit else #the directory is not empty CHUNK="" #set the chunk variable CHUNK=`zenity --text="Rar file size (kb):" --title="Rar file size" --entry` #get the size of the rar files if [ -z $CHUNK ]; then #if the chunk size is empty display error zenity --error --text="You must enter a chunk size" #error out and exit else #the chunk size is not empty rar a -v${CHUNK}k "${DIR}.rar" "$DIR" | tee >(zenity --progress --auto-kill --auto-close) >/dev/null #do the raring fi #end if for directory fi #end if for chunk size