[Tinyos-help] Re: help required run cygwin command from java

Michael Schippling schip at santafe.edu
Thu Sep 6 12:26:13 PDT 2007


This is something I have never figured out how to do correctly
so I can only toss some ideas your way...maybe looking at the
cygwin.com site will help.

What you seem to want to do is to run a cygwin bash script from
an MSDOGS command shell, right?

The first place to look is reading the bash manual page.
 From a bash shell type:  man bash

However that hasn't helped me on this. Your a.sh script contains
bash commands and needs to be interpreted by that shell. The man
page seems to indicate that you can run a script file something
like "bash a.sh", but that doesn't work for me. It might just be
an issue of getting the right environment settings, but
"bash -l a.sh" doesn't seem to work right either...

I can however do this from DOS:
     bash -c "echo some stuff; type java"
so you could put your short script on the command line itself...

Anyway, your b.sh script is being interpreted by DOS,
so it starts bash, which exits immediately, and then tries to
run the subsequent commands in the DOS shell. Each line is a
separate DOS command... DOS doesn't seem to have the equivalent
of the "Here Document" to embed scripts, but you could try
using different files somehow.

mostly useless, I know...
MS

amrit kumar wrote:
> Hi All,
>  
> I am attaching the shell script(b.sh) in the mail, which when run does 
> not go beyond login (screen shot attached). The commands which are in 
> the shell are not being executed at the login prompt :(
>  
> a.sh is a modified script which when run after the login screen is 
> working fine.
>  
> If you see closely both a and b.sh are different only in their login 
> command (it exists in a and not in b).
>  
> Let me know the reason/suggestion/resolution*...... It is very urgent......*
>  
> Saikat , Its not asking for any password or username.Can there be some 
> issue due to this.
>  
> Thanking you in advance,
>  
> Amrit
>  
>  
>  
>  
> 
>  
> On 9/5/07, *amrit kumar* <amritkr at gmail.com <mailto:amritkr at gmail.com>> 
> wrote:
> 
>     Hi All,
>      
>     I am currently working on Tiny OS related stuff and am stuck with
>     the following problem. Please let me know if you have a solution.
>      
>     A part of the *java code* is required to do the following :
>      
>     1. Open bash shell (cygwin) from command prompt by running "bash --
>     login  i" on command prompt
>      
>       i.e "bash -- login  i"  does this on command prompt. bash shell
>     prompt is displayed after this.
>      
>     2. On the same bash login(bash shell prompt) change directory to 
>     "C:\tinyos\cygwin\opt\tinyos-1.x\apps\Bombilla"
>      
>       i.e  $ cd C:/tinyos/cygwin/opt/tinyos-1.x/apps/Bombilla
>      
>     3. On the same prompt run "make pc" command
>      
>     i.e $ make pc
>      
>      
>     All this has to be done through java. I even tried creating a shell
>     file to the above and calling the same from java, but every time the
>     shell gets stuck at step 1.It shows the login prompt but It does not
>     execute any command after 1st step.
>      
>     Let me know your suggestions/solutions.
>      
>     Thanks,
>     Amrit
>      
>      
> 
> 
> 
> 
> -- 
> Amrit kumar
> B.tech Computer  Science Engg
> ISM DHANBAD
> 
> http://a4amri.tripod.com <http://a4amri.tripod.com/>
> ------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

-- 
Platform: WinXP/Cygwin
TinyOS version: 1.x, Boomerang
Programmer: MIB510
Device(s): Mica2, MicaZ, Tmote
Sensor board: homebrew



More information about the Tinyos-help mailing list