PDA

View Full Version : [ubuntu] "Run in Terminal" Output



Craig73
October 14th, 2008, 12:20 AM
Hi,

I have a simple shell script (foobar.sh) that just touches a bunch of file names. If I open a terminal and run the script, I see the output from the script. If I double click on the script in Nautilus and select "run in terminal" I see no output. (At first I assumed it was going by too quick and changed the terminal defaults to keep the terminal window open, but still no output)

Should I be expecting to see output here?

[I'm running Nautilus 2.24.0 in Intrepid, but I posted here because I remember it also not working in Hardy]

caljohnsmith
October 14th, 2008, 02:53 AM
I've never been able to get the "run in terminal" feature to work the way I want it, so if I want to run my shell scripts in a terminal from the launcher, I do it with:

gnome-terminal -x bash -c "script.sh;read -n1"
Note the "read -n1" will make it so the terminal will stay open until you press any key. Try experimenting with it with something simple like:

gnome-terminal -x bash -c "free;read -n1"
And you'll see what I mean. Would something like that work for you?

Craig73
October 14th, 2008, 09:14 PM
And you'll see what I mean. Would something like that work for you?

I tried that, it seems to give me what I want with the Free command. Although trying it with my script there is still no output.

I'll play around with this and see how far I can get.

Thanks.

elmu.edana
November 9th, 2008, 12:53 PM
If I double click on the script in Nautilus and select "run in terminal" I see no output.

I had this problem randomly. So far it didn't occur anymore after I put
sleep 1 or
read at the end of my scripts. Seems the output isn't captured when the script terminates too early.

(intrepid, gnome)