Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-11-2012
Registered User
 
Join Date: Apr 2012
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Prevent terminal from closing after command execution

Hello,

I want to create application which launches some terminal, then some command is executed on that terminal and then prevent terminal from closing.

I started to do on gnome-terminal because the Gnome is the most widely used desktop-manager in the Linux distributions.

I want to do something like that:

Code:
gnome-terminal --sync -x tcsh -c "cd xys; command ;" &

In konsole there is a --noclose option preventing the terminal from closing after the command execution.

I can do it like that:

Code:
gnome-terminal --sync -x tcsh -c "cd xys; command xxx ; exec tcsh; " &

But then I lose the certain settings which I loaded in the terminal during the command xxx execution.

Do you know how to prevent gnome-terminal from closing after the command execution?

Moderator's Comments:
Please use next time
code tags for your code and data

Last edited by vbe; 06-11-2012 at 08:09 AM..
Sponsored Links
    #2  
Old 06-11-2012
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Location: Switzerland - GE
Posts: 4,633
Thanks: 118
Thanked 256 Times in 245 Posts
what does this command line give you:

Code:
gnome-terminal --sync -x tcsh -exec "cd xys&& command xxx; exec tcsh" &   # or:
gnome-terminal --sync -x tcsh -exec "cd xys; command xxx && exec tcsh" &


Last edited by vbe; 06-11-2012 at 08:59 AM.. Reason: typos
Sponsored Links
    #3  
Old 06-11-2012
Registered User
 
Join Date: Apr 2012
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Using && instead of ; in the command does not change the problem that if there is a exec tcsh in the end of line the settings loaded before that are lost.
I want to do
gnome-terminal --sync -x tcsh -c "cd <some_folder>; some_command ;" &
And terminal to remain opened after some_command execution.

If in xterm that is possible I can use it instaed of gnome-terminal.
    #4  
Old 06-11-2012
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Location: Switzerland - GE
Posts: 4,633
Thanks: 118
Thanked 256 Times in 245 Posts
Its the first - exec I wanted to know about for I have no tcsh... can only emulate in ksh without gnome...
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Terminal is closing on exit in ksh vij_krr Shell Programming and Scripting 3 02-09-2010 02:46 AM
Closing sockets with shell-command ? trutoman Shell Programming and Scripting 2 06-01-2009 11:53 AM
Terminal Execution By Giving a Command indiansoil Linux 2 07-07-2008 04:25 PM
How to prevent an application from closing a file jasahl AIX 4 01-06-2008 08:39 PM
how to run a process after closing the terminal lakshmananindia UNIX for Advanced & Expert Users 3 09-03-2007 11:05 AM



All times are GMT -4. The time now is 03:34 AM.