X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <ff8e9dfe0801250754k3ec2ad95ycfba0f53c420fb3f@mail.gmail.com>
Date: Fri, 25 Jan 2008 16:54:59 +0100
From: "Mirco Piccin" <pictux@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Cygwin - batch file
In-Reply-To: <15089652.post@talk.nabble.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <15088393.post@talk.nabble.com> 	 <ff8e9dfe0801250619yb402fb8ya626559a48888ed6@mail.gmail.com> 	 <15089652.post@talk.nabble.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Sorry but my english is quite poor, so i don't understand well your question.
So, correct me if i'm going wrong.

> it works perfect, but i have to give the cygwin script under C:\Documents
> and Settings\user myscript.ksh!
>
> how can i make it to have a directory, for eg C:\mybatchconversion where all
> files are there?

You want to run with cygwin a .ksh file stored in  "C:\Documents and
Settings\user" ?
Well, in cygwin the system drive are mapped in this way :

$ mount
C:\cygwin\bin on /usr/bin type system (binmode)
C:\cygwin\lib on /usr/lib type system (binmode)
C:\cygwin on / type system (binmode)
c: on /cygdrive/c type system (binmode,noumount)

...so i can do:
$ cd /cygdrive/c/Documents\ and\ Settings/<user>/
...to switch to Win <user> home directory.

I recommend to soft link your Windows home directory (C:\Documents and
Settings\<user>) to the linux home folder (/home/<user>) in this way:

$ mv /home/<user>/  /home/<user>.old/
(move the original folder to another)

$ ln -s /cygdrive/c/Documents and Settings/<user>  /home/<user>
(link the Win home dir to cygwin linux home dir)

$ cp -R /home/<user>.old/ *  /home/<user>/.
(right to have the .profile .bash* file)

In this way, cd to /home/<user>  and you will find yourself in your
Win home dir.

Of course, you can soft link any other path.
Remeber only that the Windows C: drive in cygwin environment is /cygdrive/c/.

So, coming back to our .bat file:

....
bash --login -i -c '/cygdrive/c/Documents and Settings/<user>/script.ksh'
...

-or, if you soft link Win home dir to /home/<user>:
...
bash --login -i -c '/home/<user>/script.ksh'
...

Hope i understand well :-D
M

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

