Using real paths in ash

Buchbinder, Barry (NIH/NIAID) [E] BBuchbinder@niaid.nih.gov
Tue Apr 21 15:32:00 GMT 2009


Stephen Paul Weber wrote on Tuesday, April 21, 2009 9:59 AM:

> On Tue, Apr 21, 2009 at 06:50, Buchbinder, Barry (NIH/NIAID) [E]
> <BBuchbinder@niaid.nih.gov> wrote: 
>> Stephen Paul Weber wrote on Tuesday, April 21, 2009 9:39 AM:
>>> I really like the cygwin ash.exe, but I have a problem.  It tries to
>>> replace C: with /cygdrive/c everywhere.  This actually breaks my
>>> utilities, because they expect real Windows paths.  mkdir -p
>>> "$TEMP/t" for example ends up creating
>>> C:\cygdrive\c\DOCUME~1\NEWUSE~1\LOCALS~1\Temp\t  ... which is
>>> obviously not what I want.
>> 
>> man cygpath
>> 
>> Don't forget quotes, e.g.
>> 
>> $ mkdir -p "$(cygpath -u "${TEMP}/t")"
> 
> Ok, I'm aware of cygpath, but the question was how can I actually fix
> the problem.  See, I want to use it as a shell script interpreter on
> Windows, and if I throw cygpath calls all over my shell scripts, then
> they won't run on UNIX anymore.   
> 
> I've been poking at the ash and pdksh code to see if I can figure out
> at what point this broken behaviour gets introduced, but so far no
> luck with finding it or with compiling either of them.  

Perhaps what you want is something that uses native Windows paths.  (To
elaborate on Dave Korn's email, "Get the right tool for the right job.")
Perhaps MSYS et al.?  <http://www.mingw.org/>  But now we're both off-
topic and far outside the area of my limited expertise.


More information about the Cygwin mailing list