This is the mail archive of the
cygwin-xfree
mailing list for the Cygwin XFree86 project.
Re: Checking if the X Server is running
- From: Gary Johnson <garyjohn at spk dot agilent dot com>
- To: cygwin-xfree at cygwin dot com
- Date: Sun, 30 Sep 2007 17:31:53 -0700
- Subject: Re: Checking if the X Server is running
- References: <20070930222902.GA3545@suncomp1.spk.agilent.com> <896735.31233.qm@web27001.mail.ukl.yahoo.com>
- Reply-to: cygwin-xfree at cygwin dot com
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/