LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   gnome-terminal problem (https://www.linuxquestions.org/questions/linux-software-2/gnome-terminal-problem-731564/)

rjb356 06-08-2009 11:58 PM

gnome-terminal problem
 
I have added to my ubuntu 9.04 applications/system tools menu the following command:

gnome-terminal --command="pwgen -s"

This works fine in ubuntu 8.04, but in 9.04 the terminal windows flashes open and then closes instantly, without my being able to read the generated passwords and then close it myself.

Is this a bug in 9.04 or am I doing something wrong.

BTW if I type into a open terminal window in 9.04:

pwgen -s

Then passwords are generated, and I can choose one and then close the terminal.

JulianTosh 06-09-2009 07:07 AM

When I attach a "shortcut" that requires gnome-terminal to my gnome panel, I need to check a box in the properties that says "run in terminal".

Perhaps you can try that?

ozminh 06-09-2009 08:22 AM

try 'read'.

'read -t 20' should keep the window in 20s.

there's more options in the man page.

rjb356 06-09-2009 11:09 AM

gnome-terminal problem
 
Thanks for both responses so far.

Admiral Beotch:

I tried your suggestions, using the following in the command box:

gnome-terminal --command="pwgen -s"

and

pwgen -s

Both cause the same response of flashing open and closing the terminal window, not allowing me to read what is in the terminal window.

When the "application in terminal' is used, then the "pwgen -s" command is all that is necessary (nice to know).

ozminh:

I tried "man read" and I got the response "no manual entry for read".

When I googled it, I got what appears to be info about a script command (I'm relatively new to Ubuntu and don't know much about scripts, but it seems they are much like the old DOS batch files). I was attempting to do this by placing a command in the edit menus section - command box.

So at this point I'm still not understanding why, what works in ubuntu 8.04, seems to not work the same in version 9.04.

Any other suggestions.

Thanks,

RJB

JulianTosh 06-09-2009 11:30 AM

I tried two things and I like neither...

http://ubuntuforums.org/showthread.php?t=276502

or make a script with "pwgen -s ; read" and have your launcher call the script. (YUK!)

rjb356 06-10-2009 11:02 AM

gnome-terminal problem
 
Admiral Beotch:

Thanks for your second response.

The link you suggested had a workable solution for me.

The answer was to not use gnome-terminal (which seems to have a bug in ubuntu 9.04) and use xterm. Creating a "shortcut" in the edit menus as follows worked:

xterm -hold -e pwgen -s

My only problem with this was the font size in xterm was too small for my poor eyesight, so I check out the man pages for xterm (there is over 4000 lines in the man pages - an amazing array of commandline options) and found, after some trial and error, that the following gave me a much larger and readable font that satisfied me:

xterm -hold -fa -fs -e pwgen -s

Again, thanks for your help. Though what I was attempting to create was a bit silly since I could have just opened a gnome-terminal window and type:

pwgen -s

and gotten the same result. But the truth is I was using this simple question to learn more about the commandline, terminal, linux etc. as I have been switching my computers to linux due to my unhappiness with both Windows and Microsoft Corporation.

I am liking linux, but there does seem to less polished software available, and I'm hoping in the future more gui frontends will be developed so that the more complex commandline usage could be avoided.

RJB

JulianTosh 06-10-2009 12:05 PM

Like they say, "Linux is easy after the first 500 hours."... You'll soon learn to appreciate and love the linux command line too. Stick with it!

ozminh 06-11-2009 06:32 AM

Quote:

#! /bin/bash

echo "`df -m`" > /tmp/tmp-minh-xterm-df

xterm -geometry "`wc -L /tmp/tmp-minh-xterm-df | head -c 2`"x"`wc -l /tmp/tmp-minh-xterm-df | head -c 1`" -e "cat /tmp/tmp-minh-xterm-df; rm /tmp/tmp-minh-xterm-df; read -t 20"

exit 0
this's fine.


All times are GMT -5. The time now is 03:43 PM.