Looks like you are not getting the progress of the command in your output, check it out by running your command without the | zenity --progress --percentage=0 --auto-close
pipe.
Try something like this to get your output, first you need to apt-get install screen
if you don't have it installed:
screen -L bash -c '(while :; do tail ~/screenlog.0 | grep -o "[0-9]*%" | tail -1; done | zenity --progress --auto-close &); 7z a "output.zip" "/path/to/input"'
I'll break down the most important parts of the command:
- screen -L This flag tells the
screen
command to start a new session and log all terminal output to a file,~/screenlog.0
by default. - bash -c COMMAND1 Spawn a subshell and run
COMMAND1
in it. - (COMMAND2 &) Spawn another subshell that will launch
COMMAND2
in the background. - while :; Start an infinite loop.
- tail FILE Read last 10 lines of
FILE
. - grep -o Print only the matched (non-empty) parts of a matching line.
- [0-9]*% Any series of digits followed by the % symbol.
- tail -1 Read last line of previous piped command.