Hello,
I am new to creating batch files.
I am trying to launch an application called cygwin and then when the shell opens, I'd like to submit 3 commands, each having a carriage return, then exit the application.
Can anyone please advise?
Best regards,
Zack H.
Sending commands in batch file
Moderator: DosItHelp
Re: Sending commands in batch file
If I am not mistaken cygwin has its own shell. You should probably make your script execute within that shell instead of writing a batch file.
Re: Sending commands in batch file
Hi Squashman,
When I launch my cygwin, I get straight through the Cygwin Command Shell prompt. I am not familiar with how to create a batch from the shell.
Is there a way to do it via Batch?
Thanks!
Zack H.
When I launch my cygwin, I get straight through the Cygwin Command Shell prompt. I am not familiar with how to create a batch from the shell.
Is there a way to do it via Batch?
Thanks!
Zack H.
Re: Sending commands in batch file
Cygwin basically comes with a BASH shell. So you can basically write bash script just like you would on other Unix and Linux platforms.
So to execute a Bash script from a Batch file you would do something like this.
So to execute a Bash script from a Batch file you would do something like this.
Code: Select all
c:\cygwin\bin\bash "c:\MyScript.sh"
Re: Sending commands in batch file
I apologize but I don't use Unix. Someone was kind enough to create a process for me that works using cygwin. I am simply trying to automate the scripts given to me.
I tried implementing your suggestion using bash but I have had no success. I run the execution commands but screen quickly disappears.
Any help on how I can pass the commands to the cygwin shell?
TIA,
Zack H.
I tried implementing your suggestion using bash but I have had no success. I run the execution commands but screen quickly disappears.
Any help on how I can pass the commands to the cygwin shell?
TIA,
Zack H.