Here's a little Tcl script that will do what you want. The Wish interpreter should be installed by default on Ubuntu.
#!/usr/bin/wish
pack [label .msg -text [lindex $argv 0]]
pack [entry .ent]
bind .ent <KeyPress-Return> { puts [.ent get]; destroy . }
focus .ent
Call it like this:
myanswer=`gui-prompt "type your answer and press enter"`