Using output of shred for zenity progress bar

88 views Asked by At

Hello I am new to Linux and wanted to creat a progress bar with zenity using the output of shred. I tried to pipe the output into an echo. But echo doesnt use the input. I also tried piping it into a variable and print it with echo. This also didnt work.

My shred command looks like this:

sudo shred -vfn 1 /dev/sda

I tried it like this.

( ...some commands... sudo shred -vfn 1 /dev/sda | { shredprog=$(cat); echo "# $shredprog"; } ...some commands... ) | zenity --title="TestProgress" --progress

You can see I only want the output to be displayed as text because the progress bar is not only for the shred command, but the rest of the script is working.

I am working on an debian bullseye xfce offline system, so the Software I can use is limited. Dont worry that I want to shred sda because I want to run this script from a live system I build with live-build.

0

There are 0 answers