This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
RE: translate UNIX path to DOS path
- To: 'cygwin-list' <cygwin at sourceware dot cygnus dot com>
- Subject: RE: translate UNIX path to DOS path
- From: "Schaible, Joerg" <Joerg dot Schaible at gft dot de>
- Date: Thu, 23 Sep 1999 10:19:37 +0200
- Cc: 'Jan-Friedrich Mutter' <mutter at informatik dot uni-muenchen dot de>
Extract from my .bashrc:
function dospath
{
local cr=$(echo -e "\r")
pushd "$1" > /dev/null 2>&1
# Use command.com to get 8.3 name,
# have to remove trailing carriage return
echo $(command.com /c cd) | sed -e s#$cr##g
popd > /dev/null 2>&1
}
function dosname
{
local p=$(dirname "$1")
local dos=$(dospath "$p")
local cr=$(echo -e "\r")
# Use command.com to get 8.3 name,
# have to remove trailing carriage return
echo $(dospath "$p")/$(cmd.exe /c dir /x /b $dos\\$(basename "$1")) |
sed -e s#$cr##g
}
Greetings
Jörg
> -----Original Message-----
> From: Jan-Friedrich Mutter [SMTP:mutter@informatik.uni-muenchen.de]
> Sent: Thursday, September 23, 1999 10:07 AM
> To: cygwin@sourceware.cygnus.com
> Subject: translate UNIX path to DOS path
>
> Hi,
>
> is there a program or script available which translates UNIX paths to DOS
> paths.
> E.g.:
> /proj is mounted on D:\rootdir\proj
>
> When I do a 'pwd' in /proj, I get /proj, but I need D:\rootdir\proj
>
> Thanks in advance,
> Jan.
>
> Jan-Friedrich Mutter <jmutter@bigfoot.de>
> [http://www.bigfoot.com/~jmutter]
>
>
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com