Results 1 to 4 of 4

Thread: Cannot pipe gdialog output to variable

  1. #1
    Join Date
    Dec 2009
    Beans
    Hidden!

    Cannot pipe gdialog output to variable

    I'm trying to use the output from gdialog's input box in another command with no success.

    Code:
    var=`gdialog --inputbox something 50 50`
    Any suggestions?

  2. #2
    Join Date
    Dec 2009
    Beans
    Hidden!

    Re: Cannot pipe gdialog output to variable

    Code:
    var=$(gdialog --inputbox something 50 50)
    This doesn't work either

  3. #3
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Cannot pipe gdialog output to variable

    hi
    gdialog use stderr as stdout. you have to call it:

    bla=`gdialog --inputbox 50 50 2>&1`
    echo $bla

    ciao
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

  4. #4
    Join Date
    Dec 2009
    Beans
    Hidden!

    Re: Cannot pipe gdialog output to variable

    This works if I were putting the command into a terminal but it doesn't work from a shell script.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •