Yogarajan
Yogarajan

Reputation: 37

How do I write a shell script to run a exe

I have a exe file , how do I write a shell script to execute it. I am new to shell scripting . any help would be appreciated. thanks

Upvotes: 1

Views: 19206

Answers (2)

yoko
yoko

Reputation: 511

I am not sure if I got you right, but shouln'd this be enough?

#!/bin/sh
clear 
echo "Running exe."
*path-to-.exe*/myexe.exe
exit 0

You can also thry this for a batch script

start /d *path-to-.exe*/myexe.exe

for future researchers, this was what op expected and found out by himself

userid="user" 
password="pass" 
servicename="svc" 
path/filename $userid $password $servicename

Upvotes: 3

Pawan
Pawan

Reputation: 1605

you have to just call the binary file from shell script e.g. below script file will execute a.out binary file

shell.sh contains and execute sh shell.sh a.out

e.g. my shell.sh looks like
[root@xyz]# cat shell.sh

#!/bin/sh
./a.out

If I execute shell.sh at command prompt using "sh shell.sh", I'll see o/p of a.out binary. I hope this helps.

Upvotes: 0

Related Questions