Calling msys shell from bash script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Calling msys shell from bash script
# 1  
Old 06-13-2015
Calling msys shell from bash script

Hi all,

I am struck at a very tricky problem. Writing a bash script that calls msys.bat which inherently launches sh.exe. Now from my bash script, I call msys.bat and it creates a shell within. The problem is: I cannot pass any commands to this new shell from my bash script. I need to be able to launch msys shell and pass commands from within the bash script only. Any suggestions?
# 2  
Old 06-13-2015
Quote:
Originally Posted by sweetu1995
The problem is: I cannot pass any commands to this new shell from my bash script. I need to be able to launch msys shell and pass commands from within the bash script only. Any suggestions?
I hate to be the bearer of bad news, but: that won't work. At least it won't work without changing this msys-script.

Generally speaking: for a parameter to be passed two things are needed: an initiator who passes these parameters and a recipient who accepts them. You might succeed in passing parameters but as long as there is no provision in msys (the prospective recipient) to accept them they go nowhere. There has to be *something* inside msys to accept and use the parameters passed, regardless of which way they are being passed.

Therefore: can you change msys? If not, just call it quits (for the reasons above).

I hope this helps.

bakunin
# 3  
Old 06-15-2015
Thanks! I guess you are right. None of my attempts succeeded and I took a different route to do this.
# 4  
Old 06-15-2015
Quote:
Originally Posted by sweetu1995
I took a different route to do this.
Actually knowing what different route you took might have helped somebody with the same or a similar problem.

bakunin
# 5  
Old 06-16-2015
Couldn't you put your commands in a file and then execute them from msys via the .profile?
# 6  
Old 06-16-2015
Yes, that is what I did. I launched msys and then ran my bash script. Initially I was trying to launch msys shell and run a bunch of commands through bash script
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Calling bash script from CGI

Hi, I am having two individual scripts Script 1): CGI script - is a simple script which trigger bash script Script 2): Bash script - is a script which execute which collects file system utilization information from all the Unix servers If I am executing CGI script manually from command... (2 Replies)
Discussion started by: Naveen.6025
2 Replies

2. Shell Programming and Scripting

Password check in bash script calling on expect

password check in bash script calling on expect Background: I have to copy a file from one server, to over 100 servers in a test environment. once the file is copied, it requires to have the permissions on the file changed/verified. These are all linux servers. most of them have the same... (1 Reply)
Discussion started by: 2legit2quit
1 Replies

3. Shell Programming and Scripting

Calling bash script works when called manually but not via Cron?

Hi, I've got a Bash backup script I'm trying to run on a directory via a cron job nightly. If I ssh in and run the script manually it works flawlessly. If I set up the cron to run evertything is totally messed up I don't even know where to begin. Basically the path structure is ... (6 Replies)
Discussion started by: wyclef
6 Replies

4. Shell Programming and Scripting

Calling function from another bash script

I would like to call functions from another bash script. How can I do it? Some code More code (11 Replies)
Discussion started by: kristinu
11 Replies

5. Shell Programming and Scripting

Calling a Perl script in a Bash script -Odd Situation

I am creating a startup script for an application. This application's startup script is in bash. It will also need to call a perl script (which I will not be able to modify) for the application environment prior to calling the application. The problem is that this perl script creates a new shell... (5 Replies)
Discussion started by: leepet01
5 Replies

6. Red Hat

Calling BASH script from JAVA

Hi, I am trying to call a bash script from a java file. Code to call bash script will look like: Runtime runtime = Runtime.getRuntime(); Process process = runtime.exec("mybashfile.sh"); It is succesfully calling the bash file. I am using simple rm commands in the script to remove... (0 Replies)
Discussion started by: lakshman.forums
0 Replies

7. Shell Programming and Scripting

Quick question: calling c-shell script from bash

Hello, I have a quick reference question: I have a very long, but fairly straigtforward script written in c-shell. I was wondering if it is possible to call this script from bash (for ex. having a function in bash script which calls the c-shell script when necessary), and if so, are there any... (1 Reply)
Discussion started by: lapiduslost
1 Replies

8. Shell Programming and Scripting

Calling bash command in perl script

Hi, I have tried several times but failed, I need to call this script from the perl script. This one line script will be sent to /var/tmp/error Bash command: /usr/openv/netbackup/bin/admincmd/bperror -backstat -l -hoursago 12 |awk '{ print $19, $12, $14, $16}'|grep -vi default|sort >... (12 Replies)
Discussion started by: sQew
12 Replies

9. Shell Programming and Scripting

cant get a counter to work in bash scipt, this is calling expect script

I have looked high and low, tryed lots of diffrent things but cant get a simple counter to work right. what i need is to increase a count ever time it finishes the test, pass or fail. example TEST PASS 1, NEXT TEST PASS 2, I curently have set foo o while {$foo <=5} { incr foo puts... (1 Reply)
Discussion started by: melvin
1 Replies

10. Shell Programming and Scripting

calling 'n' number of shell scripts based on dependency in one shell script.

Hello gurus, I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script. i m looking for something like this call 3.1; If 3.1 = "complete" then call 3.2; if 3.2 = ''COMPlete" then call 3.3; else exit The... (1 Reply)
Discussion started by: shashi369
1 Replies
Login or Register to Ask a Question