starting an executable..


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting starting an executable..
# 1  
Old 07-16-2008
Error starting an executable..

I need a perl script that needs to start an executable in a different shell so that I can use this to run more commands from my script. This is what I have:

my $USER = "my_user_name";
mu $HOST = "hostname";
my $ssh = 'ssh $USER@'."$HOST";
my $cmd = "cd $EXE_DIR && sudo $EXE $EXE_PARAMETERS";
# To start the executable...
system ("$ssh '$cmd' < temp_pipe 2>&1 &");

# To run commands on this ...
if (some condition)
$cmd = "Enable module 1";
system("$rsh '$cmd'" );
else
$cmd = "Enable module 2";
system("$rsh '$cmd'" )

When I do an rsh, it complains saying the executable hasnt been started. Any suggestions?

Thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g. File name: File.txt cat File.txt Result: #INBOUND_QUEUE=FAQ1 INBOUND_QUEUE=FAQ2 I want to get the value for one which is not commented out. Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies

2. Shell Programming and Scripting

who renamed my executable

Hi All, I connected via rlogin in testing environment (ksh ) and placed an executable with -rwxr-xr-x permission. eg: from my own unix box used : rlogin host -l user But the exe was renamed by somebody. since it's only renaming none of the access time , modification time etc is altered.... (2 Replies)
Discussion started by: blackcat
2 Replies

3. Shell Programming and Scripting

Not executable

I want to check whether a file is not executable or not? means instead of knowing whether a file is executable or not: if ........... I want to check: if file is not executable (1 Reply)
Discussion started by: proactiveaditya
1 Replies

4. UNIX and Linux Applications

Tar executable

Hi, I need to download tar.exe to archive the files before doing gzip...... I downloaded the executables from Browse GnuWin Files on SourceForge.net but my concern is whether this particular exe is safe to use? is it a licensed version? Have anybody downloaded from this site? Need ur advice. (2 Replies)
Discussion started by: Codesearcher
2 Replies

5. Programming

Executable file in C

Hi all, I have modified a C file and executed it. While executing the executable file for that C file, it shows à is cannot be printed. I have given isprint(à) to test it. When I copy the old executable file and execute it it shows it can be printed. Then I retain the C code back and executed it... (1 Reply)
Discussion started by: sivakumar.rj
1 Replies

6. UNIX for Dummies Questions & Answers

executable files

hello. My question, basically is: what is the definition of unix/linux exec files, or what makes a file executable? More specifically, must a unix source file that was compiled using gcc have exec permissions in order to be considered executable? Is it right to say that a unix/linux exec file... (1 Reply)
Discussion started by: nadavkri
1 Replies

7. Shell Programming and Scripting

executable file

Hi, I want to know that how can i read the content of a .exe file?? Thanks (1 Reply)
Discussion started by: ss_ss
1 Replies

8. Shell Programming and Scripting

Executable file

Hi everybody: I have strange problem. I have compiled a source code and created an executable file. This file I can use it into my PC, but when I copy this executable to my laptop this one doesn't work and the system tell me: bash: ./sbdart_unix: cannot execute binary file Somebody can... (3 Replies)
Discussion started by: tonet
3 Replies

9. UNIX for Dummies Questions & Answers

Executable files

This question always confuses me :- Suppose I write a program and compile it on a machine with operating system A and processor B will the exe file run on a machine with operating system A2 but processor B operating system A but processor B2 operating system A2 and processor B2........ ... (9 Replies)
Discussion started by: nervous
9 Replies

10. UNIX for Dummies Questions & Answers

TK executable?

hi All, Can any one help me to find out a solution for creating an Executable file for a TK widget script. Is there any command line option for it. I am working in HP Unix workstation. Regards, Anent (3 Replies)
Discussion started by: anent
3 Replies
Login or Register to Ask a Question
SHUNIT2(1)																SHUNIT2(1)

NAME
shunit2 - A unit test framework for shell scripts SYNOPSIS
shunit2 unitfile DESCRIPTION
shUnit2 is a xUnit unit test framework for Bourne based shell scripts, and it is designed to work in a similar manner to JUnit, PyUnit, etc.. If you have ever had the desire to write a unit test for a shell script, shUnit2 can do the job. You can either run shunit2 directly from the commandline and specify the unit file or directly source the shunit2 executable. If you directly execute shunit2 and don't specify a unitfile shunit2 assumes a empty testfile and will return without an error message. EXAMPLE
Simple script to test if 1 equals 1 #! /bin/sh testEquality() { assertEquals 1 1 } # load shunit2 . shunit2 Execute shUnit2 unit tests directly from the commandline shunit2 /path/to/unit/file OPTIONS
shunit2 does not support any commandline options at all. You can either source shunit2 to execute your unit tests or directly run shunit2 as a commandline script. SEE ALSO
For more information see http://code.google.com/p/shunit2/ or have a look at the installed documentation in /usr/share/doc/shunit2/ AUTHOR
shunit2 was written by Kate Ward <kate.ward@forestent.com>. This manpage was written by Ulrich Dangel <mru@spamt.net>. 2.1.6 03/25/2012 SHUNIT2(1)