bash script using dialog

Tim Frost timfrost at xtra.co.nz
Mon Jan 30 20:31:03 UTC 2006


On Mon, 2006-01-30 at 16:52 +0000, Thomas Beckett wrote:
> I have created a script that I use when installing on new machines
> that automatically copy over settings files from CD to their correct
> place. This is done using dialog. I now want the script to show the
> output of a compilation. I have tried:
> 
>  dialog --backtitle "Compiling klips program" --tailbox $OUTPUT 15 45
> cd /tmp/openswan* ; make programs >> $OUTPUT
> 
> where $OUTPUT is a previously created file.

try changing the order:


# start the compile in background in its own subshell
(cd /tmp/openswan* ; make programs >> $OUTPUT &)
dialog --backtitle "Compiling klips program" --tailbox $OUTPUT 15 45


the parentheses mean that the cd affects the make command, and *not* the
dialog and the rest of the script.


The '&' on the first line puts the make into the background, allowing
the script (and hence the dialog command) to continue.
> 
> The dialog does show with the box to show the text but nothing is
> displayed. This is presumably because it waits for the user to exit
> before actually starting the compilling in the second command. I then
> tried with --tailboxbg thinking that this will background the process
> and start the compilation, then showing the text in the box but all I
> get is the blue background of dialog and no text box at all.
> 
> Does anyone know if I am going about this in the correct way or if
> there is any other way to show the output of the compiling using
> dialog. All the rest of the script is done in dialog so I dont really
> want to drop the user back to the terminal to do the compiling.
> 
> Many thanks for any help
> 
> Tom
> 





More information about the ubuntu-users mailing list