View Full Version : Bash: opening a new terminal window and having it run a command
shakin
May 11th, 2005, 04:19 PM
Simple question: I have a bash script that needs to open a gnome terminal and pass in a command as a paramater.
eg.
gnome-terminal 'vi filename'
but of course that example doesn't work.
Any ideas are appreciated.
Thanks.
bihe
May 11th, 2005, 04:23 PM
Simple question: I have a bash script that needs to open a gnome terminal and pass in a command as a paramater.
...
e.g. gnome-terminal -e 'ssh root@foo.bar'
~$ man gnome-terminal
> -e, --command=STRING
> Execute the argument to this option inside the terminal.
works the same with xterm, konsole, ...
shakin
May 11th, 2005, 04:32 PM
e.g. gnome-terminal -e 'ssh root@foo.bar'
~$ man gnome-terminal
> -e, --command=STRING
> Execute the argument to this option inside the terminal.
works the same with xterm, konsole, ...
Thanks, but that actually didn't work. It launched the new window but failed to execute any commands. I did get it to work with the -x option:
gnome-terminal -x ssh root@foo.bar
rocuan
May 31st, 2010, 08:31 PM
Great tip Thanx!
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.