can I run a exe which is at bin dir from my script.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting can I run a exe which is at bin dir from my script.
# 1  
Old 10-19-2010
MySQL can I run a exe which is at bin dir from my script.

Hello forum memebers.
I have command which is exe of C- program from my script.i am writing a script which is under path /abc/xyz/test.sh.
the script consist the command which is the exe of c-prog and the exe is present in the /abc/xyz/bin.if run the command from the /abc/xyz its running and if try to run from my script file its not running.
so can anyone please suggest me how to handle it.

Thanks in advance.
rajkumar_g
# 2  
Old 10-19-2010
Please show us your script - the part where it tries to run the executable.
# 3  
Old 10-19-2010
Watch the $PATH or use absolute path: /abc/xyz/bin/yourfile.exe
# 4  
Old 10-19-2010
There are two ways.

1) First set your bin path to the $PATH env variable.
Code:
export PATH=$PATH:/abc/xyz/bin/

Then you can run the exe from your script by just calling the name.

2) Call the exe using the absolute path from the script
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to convert my /bin/sh script with cgi and html to run it on browser!??

Hello, I want to run this script on my CentOS 6 via browser : ________________________________________________________________________________________________ #!/bin/sh echo Username? read MY_NAME echo Provisional file name? read MY_FILE echo File NAME you want to save? read MY_FILE2... (16 Replies)
Discussion started by: juta2020
16 Replies

2. Shell Programming and Scripting

Run .exe inside shell script

I have to run some shell scripts in Windows using Cygwin. I am able to achieve that using %BASH% --login -i "/cygdrive/d/script.sh" , where %BASH% is an environment variable in Windows set to C:\cygwin\bin\bash.exe. I have a created a Cygwin environment variable $EXE_PATH =... (3 Replies)
Discussion started by: HemanthJayasimh
3 Replies

3. UNIX for Dummies Questions & Answers

How do I run a .bin file in another directory in a script?

The way this works from the command prompt is: ___________________________________________ cd /data/local/bin chmod 0755 file.bin ./file.bin _______________________________________________ How do I make this happen in a script. The file must be run in its directory but I can not get the... (2 Replies)
Discussion started by: chrstdvd
2 Replies

4. Shell Programming and Scripting

Script to run a command on all txt files present in a dir structure

Hi, I have a directory structure like the one given below root\a\b1 root\a\b2 root\b\b1 root\b\b2 . . . root\j\b1 root\j\b2 Now, there are a txt files in each dir and subdir, there is a root.txt I have to write a script where in i have to run a command called "genrb <filename>"... (6 Replies)
Discussion started by: vikramsinghnegi
6 Replies

5. UNIX and Linux Applications

Is it possible to run .exe in unix

hi friends i want to know if its possible to run windows exe files in unix.... i know the file system in windows and unix are totally different. but is there any application which allows this???? (2 Replies)
Discussion started by: vikashtulsiyan
2 Replies

6. HP-UX

How to run .exe file

Hello, I have an test.exe file under a directory. When i execute the .exe file directory from the prompt, i get following error: $ test.exe <enter> ksh: test.exe: not found How do i solve this error? TIA, Ramesh (1 Reply)
Discussion started by: brap45
1 Replies

7. Linux

How to run .exe

Hai, is there any way to run an .exe file in unix environment . i have read that WINE HQ supports this concept but its very inconsistent and upto the user risk . but i tried WINE but iam not able to configure it can any one help me in this matter Regards Sanju (1 Reply)
Discussion started by: sanjustudy
1 Replies

8. UNIX for Dummies Questions & Answers

not able to run base64 exe

Hi, I have copied base64.exe under base64-1.3 folder and i am trying to run base64.exe from another folder called Request. But i am getting the following error message. mga.ksh: base64: not found Please let me know how to execute the base64.exe from a directory where it is not installed. ... (0 Replies)
Discussion started by: lotus123
0 Replies

9. Shell Programming and Scripting

script to go to a different dir to run a commandline prompt in that dir

Hi, I need to know how I'll be able to write a script that can goto a different dir where I don't have access to read,write and execute and also to run a commandline prompt in that dir with one file whose path has to be specified in that command. Will I be able to do this? Any ideas or... (2 Replies)
Discussion started by: ann_124
2 Replies

10. Shell Programming and Scripting

Run an exe from different folder

Am trying to run a exe on my unix machine from a different folder. For instance, i have a perl file in a folder /home/asif/runprj.pl which runs a exe in a different folder /home/projects/cobsat/a.out and my perl file is something like this #!/usr/bin/perl... (1 Reply)
Discussion started by: Asif Ali
1 Replies
Login or Register to Ask a Question