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-10-01, O. Olson wrote:
> --- Gary Johnson <garyjohn@spk.agilent.com> ha
> scritto: 
> > 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
> > 
> Thank you Gary. I think that the DOS line endings were
> the problem. Once I did the conversion - this script
> worked exactly as I wanted. 
> 	Now I am working on trying to see if I can somehow
> execute this script from a batch file i.e. by just
> clicking on it. I am not having success in this area -
> so if you have ideas let me know. 
> 	By the way thanks for pointing out that I need to put
> this in /usr/local/bin . I would be doing that from
> now on. 

You're welcome.

I've written a few batch files that call Bash scripts, but to be 
honest, I seldom get these right the first time--there is usually 
some aspect of the transition from Windows/DOS to Cygwin that I 
overlook.  Since you're not giving yours any arguments, though, it 
should be pretty straightforward.  I think the following should 
work.

   @echo off
   C:\cygwin\bin\bash --login /usr/X11R6/bin/sd.sh

Note the --login argument to bash.  That insures that your script 
sees a normal login environment, including a proper PATH.

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]