Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Prevent terminal from closing after command execution Post 302653937 by tyanata on Monday 11th of June 2012 03:52:48 AM
Old 06-11-2012
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:
Mod Comment Please use next time
code tags for your code and data

Last edited by vbe; 06-11-2012 at 09:09 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to run a process after closing the terminal

i want to execute a shell script even if the terminal is closed. how to do? (3 Replies)
Discussion started by: lakshmananindia
3 Replies

2. AIX

How to prevent an application from closing a file

I'm writing some software tests, & one of my test cases is to prevent an address space from closing a data file (file is closed & a new one opened every 15 minutes). I can't remove or rename the file while it's being written to, any other ideas to prevent a file from being closed - or at least... (4 Replies)
Discussion started by: jasahl
4 Replies

3. Linux

Terminal Execution By Giving a Command

Hi Guys, I am using Red Hat Linux 5 and GNOME Terminal is available there in the Accessories menu of Applications. But I don't see any run command option which can be used to type the name of the terminal and execute it directly as I used to do it under Mandrake Linux wherein I would type... (2 Replies)
Discussion started by: indiansoil
2 Replies

4. UNIX for Dummies Questions & Answers

xterm closing automatically after command excution

Hi, I have a commands in a file called commands.file, I am using this file with the following commnad xterm -e "commands.file" After executing this file in the new xterm, it is closing automatically. I want to use that xterm after that. Please help me regarding this? :) ... (4 Replies)
Discussion started by: chaitubek
4 Replies

5. Shell Programming and Scripting

Closing sockets with shell-command ?

Hello everyone. (I have found in this forum lots of infos about closing socket in c, and others lenguages but never with shell-command) Im developing a tool over tcl/tk; in this application i open a socket to communicate with a ada application. In the init script i open both programs (tcl... (2 Replies)
Discussion started by: trutoman
2 Replies

6. Cybersecurity

prevent user from excute command

Dears I want to prevent users from doing spesific command "history -c" or "history" in general How can I do ? (4 Replies)
Discussion started by: reaky
4 Replies

7. Shell Programming and Scripting

Terminal is closing on exit in ksh

hi while executing the following script, my terminal window is getting closed if I enter a invalid option. I want the script should go back the the command prompt. how to do achive it. i execute the script as . ./test #! /usr/bin/ksh Printf " Type of Installer : \n\t\t 1. Whole Build... (3 Replies)
Discussion started by: vij_krr
3 Replies

8. Shell Programming and Scripting

Sed command to replace with pattern except for text and closing parentheses

Can someone help me with a sed command: There will be multiple occurences in a file that look like this: MyFunction(12c34r5) and I need to replace that with just the 12c34r5 for every occurrence. The text between the parentheses will be different on each occurrence, so I can't search for that.... (4 Replies)
Discussion started by: missb
4 Replies

9. Shell Programming and Scripting

How to prevent command from deleted

Hi, I've been searching around for solution, hope that some gurus here can help. I'm using some commands in my shell script and I'd like to protect these command to be moved to another directory. For instance, cp currently in /bin/cp. If I move it to /bin/cpxxx, my script will not be able to... (3 Replies)
Discussion started by: gklntn
3 Replies

10. Answers to Frequently Asked Questions

How to prevent sed command removing whole line?

hello, I'm using sed command to extract the text between 2 special characters which are /* and */ I used following command to do this. sed -n '/\/\*/,/\*\//p' file.txt But if the file.txt contains a line something like this, a=5; /* this is a comment */ the above command... (3 Replies)
Discussion started by: beginner_99
3 Replies
ul(1)							      General Commands Manual							     ul(1)

Name
       ul - process underscores for terminal

Syntax
       ul [-i] [-t terminal] [name...]

Description
       The  command  reads  the  named files (or standard input if none are given) and translates occurrences of underscores to the sequence which
       indicates underlining for the terminal in use, as specified by the environment variable TERM.  The -t option overrides  the  terminal  kind
       specified  in  the  environment.  The file /etc/termcap is read to determine the appropriate sequences for underlining.	If the terminal is
       incapable of underlining, but is capable of a standout mode then that is used instead.  If the terminal can overstrike, or  handles  under-
       lining automatically, degenerates to If the terminal cannot underline, underlining is ignored.

       The  -i option causes to indicate underlining by a separate line containing appropriate dashes `-'; this is useful when you want to look at
       the underlining which is present in an output stream on a crt-terminal.

Options
       -i Displays underscoring on separate line containing appropriate dashes (-).

       -t terminal
	  Uses type of specified terminal in place your terminal's type.

Restrictions
       The command usually outputs a series of backspaces and underlines intermixed with the text to indicate underlining.  No attempt is made	to
       optimize the backward motion.

See Also
       man(1), nroff(1), colcrt(1)

																	     ul(1)
All times are GMT -4. The time now is 01:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy