This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Checking if the X Server is running


On 2007-09-30, O. Olson wrote:

> Thanks Bengt-Arne for your quick reply. I think I got
> this installed. I now put the following into a file
> and am trying to execute it from the cygwin prompt. I
> get the error 
> 
> /usr/X11R6/bin/sd.sh: line 8: syntax error near
> unexpected token `fi'
> /usr/X11R6/bin/sd.sh: line 8: `   fi'
> 
> File ---------------------------
> #!/bin/sh
> if checkX
>    then
>    	xterm -e /usr/bin/bash -l
>    else
>      	XWin -multiwindow -clipboard -silent-dup-error
> 	xterm -e /usr/bin/bash -l
>    fi
> End File -------------------------------------------
> 
> I am sorry if this is a bit obvious - but I am trying
> to find a way to start applications using a windows
> batch file.

My guess is that you created that file with DOS line endings.  Try 
converting it to use Unix line endings,

   cd /usr/X11R6/bin
   d2u sd.sh

then try executing it again.

Also, I would recommend putting such scripts that you create 
yourself in /usr/local/bin rather than in a system directory such as 
/usr/X11R6/bin.  Doing so will make it easier to keep track of your 
scripts and will make it less likely that you will lose them when 
doing an update of Cygwin.

Regards,
Gary

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]