Sponsored Content
Top Forums Shell Programming and Scripting How do I launch a command on an existing terminal in unix using PERL Post 302483345 by AnuragJindal on Sunday 26th of December 2010 09:58:05 AM
Old 12-26-2010
How do I launch a command on an existing terminal in unix using PERL

Hello,

I have a PERL-TK based GUI from which I want to launch a command on an existing UNIX terminal (this is also the parent terminal for this perl based gui window). The command I want to launch is interactive (there is no intention to interact with that command from the same PERL gui i.e. no further interaction between the two processes).
I tried the following:
Option1: system("$command");
This launched the command on the parent terminal but the $command got suspended in-between because it is interactive.

Option2: system("gnome-terminal -x sh -c $command");
This launched the command in interactive mode on a "new" terminal. The problem in this case is that the terminal gets killed once the command execution completes.

Thanks in advance!

Regards,
Anurag
 

10 More Discussions You Might Find Interesting

1. Solaris

Script to launch terminal window?

Hi, I am a newbie here. Trying to find a way of writing a script to launch multiple terminal or console windows on solaris 9. I used to be able to do this using cmdtool on older versions of solaris and it was even possible to configure the size and screen position of the window and the title. ... (5 Replies)
Discussion started by: omerta
5 Replies

2. UNIX for Advanced & Expert Users

missing Path(in UNIX) when i launch a job on to unix machine using windows SSh

hi i want run an unix application from a windows program/application.i am using SSH(command line version)to log on to a unix machine from windows. the application has to read a configuration file inorder to run. the configuration file .CFG is in bin in my home directory. but the application... (1 Reply)
Discussion started by: megastar
1 Replies

3. Shell Programming and Scripting

Need help writing an Applescript to launch a specific Terminal Command...

I developed a script in Lingon (which is an automated script editor developed for OS X) that is used to automatically restart programs only if they crash. The script itself does just that, but I only want it to load if I'm going to use the specific application that it's designed to protect. In... (3 Replies)
Discussion started by: JFraser1
3 Replies

4. OS X (Apple)

Need help writing an Applescript to launch a specific Terminal Command...

I developed a script in Lingon (which is an automated script editor developed for OS X) that is used to automatically restart programs only if they crash. The script itself does just that, but I only want it to load if I'm going to use the specific application that it's designed to protect. In the... (2 Replies)
Discussion started by: JFraser1
2 Replies

5. UNIX for Advanced & Expert Users

unix command for terminal - view sequences as a single line?

Hello, I'm looking for some code that will list sequences of files as a single line. ie, sequences of files like this: filename.1.ext filename.2.ext filename.3.ext filename.4.ext filename.5.ext filename.6.ext filename.7.ext filename.8.ext filename.9.ext filename.10.ext would... (6 Replies)
Discussion started by: kentm
6 Replies

6. OS X (Apple)

Can't launch x11 remotely from terminal

After I installed OS X Lion I haven't been able to launch x11 remotely (using ssh) from Terminal. It works fine locally, and also remotely directly from the Xterm. I log in to the unix server at my university from the terminal like this: ssh -l -X login@host.com This used to launch... (1 Reply)
Discussion started by: gnyrf
1 Replies

7. Shell Programming and Scripting

who command from non terminal in unix

I was executing a command "who -ms" from a CHUI application but i get below message, It seems that who command can be executed only when we are logged directly in unix box as we have terminal. Is there a way to get rid of this problem , or anyother command where i can get machine name of the... (4 Replies)
Discussion started by: lalitpct
4 Replies

8. Red Hat

Not able to see the terminal icon in the applications menu to launch the command prompt in Centos

After installing centos iam not able to see the terminal icon in the applications menu to launch the command prompt in Centos. However iam able to see the Open Terminal menu, when i right click and it is not working. let me know what are the things i need to check.:b: (1 Reply)
Discussion started by: Kesavan
1 Replies

9. Shell Programming and Scripting

perl: Command works in terminal, but not in shell script

Hi, the following command works in the terminal no problem. samtools view -h rawlib.bam | perl -ne '{ @line = split( /\s+/ ); $match = 0; while( $line =~ /(\d+)M/g ) { $match = $match + $1 } if( $match >= 80 || $_ =~ /^\@/ ) { print $_ } }' | java -Xmx12G -jar... (8 Replies)
Discussion started by: jdilts
8 Replies

10. Shell Programming and Scripting

Cannot get terminal application to launch with a graphical launcher when successful in terminal

I have been having an extremely annoying problem. For the record, I am relatively new at this. I've only been working with unix-based OS's for roughly two years, mostly Xubuntu and some Kali. I am pretty familiar with the BASH language, as that's the default shell for debian. Now, I've made this... (16 Replies)
Discussion started by: Huitzilopochtli
16 Replies
IVMAN-LAUNCH(8) 					      System Manager's Manual						   IVMAN-LAUNCH(8)

NAME
ivman-launch - launch script for Ivman SYNOPSIS
ivman-launch [ --exit-with-session <cmd> ] [ OPTIONS ] [ COMMAND [ ARGS... ]] DESCRIPTION
ivman-launch is a simple script used to launch Ivman. Its sole purpose is to ensure Ivman is closed at the end of a user's login session. You can use it if your session manager does not properly close Ivman when you log out. ivman-launch supports the same command-line options as Ivman, and one additional option: --exit-with-session. Thus, there is no point using ivman-launch if you do not need to use this option. If you supply a COMMAND (with optional ARGS), the the specified command will be run after ivman is started, and ivman will be killed after that command exits. OPTIONS
--exit-with-session <cmd> ivman-launch will block until the command 'cmd' terminates, at which point it will kill Ivman and exit itself. If the command 'cmd' is not running when ivman-launch is started, Ivman will exit immediately. Note that this option implies Ivman will be called with the '--nofork' option. option. --debug --nofork --system These flags be passed to the launched ivman command. EXAMPLES
ivman-launch --exit-with-session xinit & The ivman process will be started, then the xinit process is watched. When the xinit process exits, ivman is killed. Placing this command in an ~/.xinitrc file would cause Ivman to launch in the background when your session begins, and exit when your session ends: ivman-launch /usr/bin/x-window-manager The ivman process is launched, then /usr/bin/x-window-manager is run, when x-window-manager exits, ivman is killed. This is an example of how ivman might be launched from Xsession in order to chain several programs together in one session. SEE ALSO
ivman(8) Xsession(5) CREDITS
This script was written by Daniele Favara. 10 February 2006 IVMAN-LAUNCH(8)
All times are GMT -4. The time now is 12:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy