help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] Event if pipe closes? Check if pipe is still open?


From: adrelanos
Subject: [Help-bash] Event if pipe closes? Check if pipe is still open?
Date: Fri, 31 May 2013 22:57:02 +0000

Hi!

Example:

   exec 3> >(\
      zenity \
      --display="$DISPLAY" \
      --timeout "86400" \
      --no-markup \
      --window-icon "/usr/share/whonix/icons/whonix.ico" \
      --title=" $TITLE " \
      --progress \
      --auto-close \
      --auto-kill \
      --text "$NOTIFY_MSG"\
   )

This works in principle quite nicely, I can use for example 'echo "50"
>&3' and the progress meter moves to 50%. I just don't know when the
user clicked "cancel".

To see, if the pipe is still open, I tried:

   if test -t 3  ; then

but that doesn't work.

How can I check if the pipe is still open?

Can I somehow add an event (like trap) and get notified if the pipe was
closed?

Cheers,
adrelanos



reply via email to

[Prev in Thread] Current Thread [Next in Thread]