Andes Workshop

It is currently Sun Sep 23, 2018 5:53 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: How to run a BASH script in a Batch file (with Cygwin)
PostPosted: Mon Aug 12, 2013 5:59 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
The execution result:
Attachment:
bat1.gif
bat1.gif [ 13.2 KiB | Viewed 2516 times ]


cindy_test_bat.bat
Code:
E:\Andestech\AndeSight201MCU\cygwin\bin\bash E:\Andestech\AndeSight201MCU\cygwin\bin\cindy_test.sh
pause


cindy_test.sh
Code:
#!/bin/bash
cd /cygdrive/e/Andestech/AndeSight201MCU/mcu/workspace2/hello/Debug
PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/bin:/cygdrive/e/Andestech/AndeSight201MCU/toolchains/nds32le-elf-mculib-v3m/bin
export PATH
make all
echo -e "Complete! \a \n"


Reference file:
Attachment:
batch_reference.7z [13.66 KiB]
Downloaded 206 times


Note: the *.sh should use UNIX format in encoding.

Reference article:
http://www.linuxquestions.org/questions ... in-594988/
Code:
c:\cygwin\bin\bash  myscript


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group