0

I have a problem. I modified a script called 'packer' a AUR-helper for Arch Linux. The problem coming when I apply my pipe, with a progress bar, doesn't show all info as I need.

This is my forked script from packer, the next line install a program from AUR

echo > /tmp/packer-url-tmp

packer-postinstallerf -S --noconfirm --noedit alchemy 
   tee /tmp/packer-url-tmp |
   stdbuf -oL sed '/\.\.\.$/ s/^/#/p' |
   zenity --progress --title="packer progress" --pulsate --width=450 --auto-close

The output without a pipe and progress bar:

http://pastebin.com/m0srNWkJ

The above line, work fine without AUR packages; but when I install a AUR program disappears the previous information (build process) to installation.

I do not understand the pipe with the progress bar should show this information.

Only show the pipe with

:: ¿Continuar con la instalación? [S/n]
(1/1) verificando llaves en el llavero             [######################] 100%
(1/1) verificando la integridad de los paquetes    [######################] 100%
(1/1) cargando los archivos del paquete...         [######################] 100%
(1/1) verificando conflictos entre archivos        [######################] 100%
(1/1) verificando el espacio disponible en disco   [######################] 100%
(1/1) instalando alchemy                           [######################] 100%
Dependencias opcionales para alchemy
    jpen: for tablet support

Please if my question isn't clear, I updated my question. I do not know how to clarify my question more :/.

closed as unclear what you're asking by Graeme, slm, Anthon, peterph, Thomas Nyman Apr 11 '14 at 12:29

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Please give an example of the packer-postinstallerf output so that non-Arch users can have an idea of what you are trying to process. Also please give more detail on what you expect to get with zenity. – Graeme Apr 9 '14 at 9:49
  • I the above comment sounds familiar to you, it is because I copied it from here. If you want people to help you with this kind of thing, you have to, at a minimum, provide information about that the input is and what you expect the output tob e. – Graeme Apr 9 '14 at 9:50
  • Hi @Graeme is very strange because the pipe only capture in the installer section ":: ¿Continuar con la instalación? [S/n] ". pastebin.com/m0srNWkJ – davidva Apr 11 '14 at 8:07
  • Hi the solution was simple: 2>&1 | tee -a /tmp/packer-url-tmp | stdbuf -oL sed -nru '/==>/ s/^/# /p' Although I explained my question with apples, was closed haha – davidva Apr 17 '14 at 2:57
1

Maybe it's because it outputs text both on stderr and stdout, and what you want to capture is on stderr ? I think you lack a pipe here

packer-postinstallerf -S --noconfirm --noedit alchemy | ...

And try to redirect stderr to stdout before the pipe:

packer-postinstallerf -S --noconfirm --noedit alchemy 2>&1 | ...

Sorry for the previous link only answer, the reference is here: https://stackoverflow.com/questions/16497317/piping-both-stdout-and-stderr-in-bash

Not the answer you're looking for? Browse other questions tagged or ask your own question.