Sponsored Content
Full Discussion: Run .exe inside shell script
Top Forums Shell Programming and Scripting Run .exe inside shell script Post 302757839 by HemanthJayasimh on Friday 18th of January 2013 05:35:01 AM
Old 01-18-2013
Run .exe inside shell script

I have to run some shell scripts in Windows using Cygwin. I am able to achieve that using
Code:
%BASH% --login -i "/cygdrive/d/script.sh"

, where %BASH% is an environment variable in Windows set to
Code:
C:\cygwin\bin\bash.exe

.
I have a created a Cygwin environment variable
Code:
$EXE_PATH = /cygdrive/d/somepath/dir

. Inside my script the line is
Code:
$EXE_PATH/some.exe -f /cygdrive/d/password.txt

There is error in this line every time I run the script. Error is something to do with the
Code:
some.exe/password.txt

not being found.
If I run the same command from the Cygwin terminal, it works fine. Is there something wrong with the environemnt variable or the way exe is executed, because of its argrument list? is this the right way to execute an exe inside a shell script?

---------- Post updated at 05:35 AM ---------- Previous update was at 05:31 AM ----------

Code:
#!/bin/sh
echo simple shell script
echo $EXE_PATH
$EXE_PATH/runube -f password.txt DVRP910 *ALL R0006P XJDE0001 QBATCH B #H S //NASRVNY/NY_02 --- this doesn't work
cat $TESTLEELA/password.txt --- this line works


Last edited by Scrutinizer; 01-18-2013 at 06:48 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to run unix commands in a new shell inside a shell script?

Hi , I am having one situation in which I need to run some simple unix commands after doing "chroot" command in a shell script. Which in turn creates a new shell. So scenario is that - I need to have one shell script which is ran as a part of crontab - in this shell script I need to do a... (2 Replies)
Discussion started by: hkapil
2 Replies

2. Shell Programming and Scripting

How to run an SQL script inside a shell

How do I create a K Shell which would silently (without user input) logon to Oracle and run an SQL script? Any help will be greatly appreciated. Steve (1 Reply)
Discussion started by: stevefox
1 Replies

3. Shell Programming and Scripting

Run the command inside perl script

I have a command which will run fine in a unix command prompt. Can you tell how to interprete this command inside perl script...... The command is : perl -pe 's/(\|333\}.*)\}$/$1|1.6}/' FIA.txt This will search for the number 333 and appends 1.6 at the end of that line....... (1 Reply)
Discussion started by: vinay123
1 Replies

4. Shell Programming and Scripting

how to run shell script inside expect script?

I have the code like this : shell script continues ... .... expect -c" spawn telnet $ip expect "login:" send \"$usrname\r\" expect "Password:" send \"$passwd\r\" expect "*\>" send \"$cmdstr\r\" ... (1 Reply)
Discussion started by: robbiezr
1 Replies

5. Shell Programming and Scripting

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... (3 Replies)
Discussion started by: rajkumar_g
3 Replies

6. Shell Programming and Scripting

send arguments to a .exe file from a shell script

Folks , can anyone post a sample showing a way to parse a variable containing a string to a .exe file . Thanks Venu (2 Replies)
Discussion started by: venu
2 Replies

7. Shell Programming and Scripting

Interpretation of $variables inside programs run from a script

Hi, I am running a shell script that executes a program. Inside this program, variables are also referenced using a dollar symbol, eg. $a, $thething, and the shell script is misinterpreting them as variables relevant to the shell script rather than relevant to the program run from inside the... (2 Replies)
Discussion started by: TheBigH
2 Replies

8. Shell Programming and Scripting

Problem run script inside a gnome-terminal

hi, I would like to ask about using gnome-terminal command, I had a script that will run my VBOX VM in headless and i want to display the output(STDOUT) on the gnome-terminal window. The purpose that i want to display the STDOUT of the script cause i will used it or create a desktop shortcut for... (11 Replies)
Discussion started by: jao_madn
11 Replies

9. Shell Programming and Scripting

How to run scripts parallely inside shell script?

Hi , I have 4 scripts example script1,script2,script3,script4 . I have to run script1,script2 and script3 parallely since this 3 scripts dont have dependencies . Once script1,script2 and script3 got completed successfully , I have to trigger script4. Can someone help me on this how to... (10 Replies)
Discussion started by: vinothsekark
10 Replies

10. Shell Programming and Scripting

Capture run time of python script executed inside shell script

I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Discussion started by: Adfire
2 Replies
chsh(1) 						      General Commands Manual							   chsh(1)

NAME
chsh - change default login shell SYNOPSIS
login-name [shell] login-name [shell] login-name [shell] login-name [shell] DESCRIPTION
The command changes the login-shell for a user's login name in the repository (see passwd(1)). The DCE repository is only available if Integrated Login has been configured; see auth.adm(1M). If Integrated Login has been configured, other considerations apply. A user with appropriate DCE privileges is capable of modifying a user's shell; this is not dependent upon superuser privileges. If the repository is not specified (as in [login-name]), the login shell is changed in the file only. Run after running to make sure the information was processed correctly. Notes The command is a hard link to the command. When is executed, actually the command gets executed with appropriate arguments to change the user login shell in the repository specified in command line. If no repository is specified, the login shell is changed in the file. Arguments login-name A login name of a user. shell The absolute path name of a shell. If the file exists, the new login shell must be listed in that file. Otherwise, you can specify one of the standard shells listed in the getusershell(3C) manual entry. If shell is omitted, it defaults to the POSIX shell, Options The following option is recognized: Specify the repository to which the operation is to be applied. Supported repositories include and Security Restrictions You must have appropriate privileges to use the optional login-name argument to change another user's login shell. NETWORKING FEATURES
NFS File can be implemented as a Network Information Service (NIS) database. EXAMPLES
To change the login shell for user to the default: To change the login shell for user to the C shell: To change the login shell for user to the Korn shell in the DCE registry: WARNINGS
If two or more users try to write the file at the same time, a passwd locking mechanism was devised. If this locking fails after subse- quent retrying, terminates. AUTHOR
was developed by HP and the University of California, Berkeley. FILES
SEE ALSO
chfn(1), csh(1), ksh(1), passwd(1), sh(1), sh-posix(1), getusershell(3C), pam(3), passwd(4), shells(4). chsh(1)
All times are GMT -4. The time now is 10:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy