delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/01/25/10:55:38

X-Recipient: archive-cygwin AT delorie DOT 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 AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Cygwin - batch file
In-Reply-To: <15089652.post@talk.nabble.com>
MIME-Version: 1.0
References: <15088393 DOT post AT talk DOT nabble DOT com> <ff8e9dfe0801250619yb402fb8ya626559a48888ed6 AT mail DOT gmail DOT com> <15089652 DOT post AT talk DOT nabble DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019