LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Help using Cygwin (https://www.linuxquestions.org/questions/linux-software-2/help-using-cygwin-896415/)

tate89 08-09-2011 02:58 PM

Help using Cygwin
 
When I ran my script in Cygwin it gives me the following:

>#!/bin/bash
"#!" is not recognized as an internal or external command operable program or batch file.

>x=0
"x" is not recognized as an internal or external command operable program or batch file. f was unexpected at this time.

>for f in *.sid; do

What should I do?

AlucardZero 08-09-2011 03:37 PM

How did you create this file?

In other words, is it using Windows EOL characters or Unix?

Try running 'dos2unix' on the file and trying again.

tate89 08-09-2011 03:43 PM

thanks

tate89 08-09-2011 03:52 PM

dos2unix
 
AlucardZero thanks for responding.

I have no background in programming. I am very new to it so can you please be very specific with me.
Quote:

Originally Posted by AlucardZero (Post 4438113)
Try running 'dos2unix' on the file and trying again.

I am using windows do I need to download dos2unix?

tate89 08-10-2011 03:16 PM

dos2unix
 
I ran dos2unix and that corrected those errors now I'm getting gdal_translate command not found. How do I correct this?

Elv13 08-10-2011 03:25 PM

Install gdal_translate, it is missing or not in your PATH. Remember, each command is an individual file, it have to be installed. Cygwin is not one fat application that have everything built in.

tate89 08-10-2011 03:47 PM

yes it is installed and set the path but it is still saying command not found

John VV 08-10-2011 06:46 PM

just HOW did you set up the cygwin environment ?
also most of the time Mingw works better on windows

and what is it you are trying to do with gdal that you need to use it in cygwin
when there is a perfictlay good windows build
http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries

also it builds just fine in MinGW and you end up with a MS windows .exe

tate89 08-11-2011 09:00 AM

I was given the bash script and I was told that I have to run bash in Cygwin.

John VV 08-11-2011 03:03 PM

go for it but i had always found cygwin to be very VERY slow
MinGW and it's bash fine ( from 2001 to 2005 i was building Gimp in Mingw )
tested KDE2 in cygwin -- so slow it was unusable.


this script is doing ? something? with gdal
cygwin can also access windows programs but gdal was built in Mingw on windows
now you could use the linux build in cygwin but why .


but if you must .....

install the linux gdal in cygwins ( a guess )
/c/CygWin/
from THE SOURCE CODE and install the full gcc development tree in cygwin

that installed cygwin.exe will have check boxes for it
and ALL of the dependencies for gdal also will need building
unless it is in the cygwin software repo -- it has been a few years since i used it ( mostly used mingw) .
It might be look for it

tate89 08-11-2011 04:14 PM

Thanks
I tried installing linux gdal but ran into problems once I added the full path of gdal to my script it worked fine.


All times are GMT -5. The time now is 02:26 AM.