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

Re: Bash Script Problem



Markus Meyer <mm@butterblume.org> wrote:

> On [Fri, Aug 19 14:12], Frank Küster wrote:
>>Ohne --stdout kommt ja nicht mal die Dialogbox.  Das wäre ein
>>schwerwiegender Bug, zumal nichts darüber in der Manpage steht.  Kann
>>das jemand auf sid reproduzieren?
>
> Jep.
>
> ii  dialog         1.0-20050306-1 Displays user-friendly dialog boxes
>
> Warum? Es steht doch in der Man-Page drin.

Ich lese da (unter sarge):

,----
| Some widgets, e.g., checklist, will write text to dialog's output.
| Normally that is the standard error, but there are options for
| changing this: "--output-fd", "--stderr" and "--stdout".  No text is
| written if the Cancel button (or ESC) is pressed; dialog exits
| immediately in that case.
`----

Demnach sollte es doch mit foo=`dialog ... 2>&1` funktionieren;
jedenfalls aber sollte eine Dialogbox gezeigt werden.  Im Gegenteil, die
manpage rät sogar von --stdout ab:

,----
| --stdout
|     Direct output to the standard output.  This option is provided for
|     compatibility with Xdialog, however using it in portable scripts
|     is not recommended, since curses normally writes its screen
|     updates to the standard output.  If you use this option, dialog
|     attempts to reopen the terminal so it can write to the display.
|     Depending on the platform and your environment, that may fail.
`----

und in der Tat kriege ich mit --stdout in meinem sid-chroot eine
Fehlermeldung:

$ foo=`dialog --stdout --nocancel --inputbox "Benutzername" 8 40 2>&1`
$ echo $foo
cannot open tty-output
$

Wenn ich dialog direkt aus der shell aufrufe, kriege ich auf dem
Hauptrechner mit oder ohne --stdout ein Fenster; aber in `` nur mit
dieser Option - das verstehe ich nicht und halte es für einen Bug.

Gruß, Frank
-- 
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer



Reply to: