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?

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

Thanks! I guess you are right. None of my attempts succeeded and 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

Couldn't you put your commands in a file and then execute them from msys via the .profile?

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