All Forums |
Register |
Login |
Search |
Subscriptions |
My Profile |
Inbox |
Tool Warehouse |
FAQs |
Resources |
Help |
Member List |
Address Book |
Logout |
|
|
winpath2unix
|
Logged in as: Guest |
Users viewing this topic: none |
|
Login  |
|
|
winpath2unix - Jun. 8, '04, 9:55:24 AM
|
|
|
tjones
Posts: 9
Joined: Jun. 4, '04,
Status: offline
|
I am calling an input file from a script which lists files in windows path format. Attempting to convert those paths with the unix format one line at a time, but it is not functioning from within the script.
If I do a
winpath2unix c:\temp\test\testing\test.txt from within the ksh script, I get
/dev/fs/C/temptesttestingtest.txt
However, if I use winpath2unix from the windows command prompt,
it works fine.
I think I must be missing something, since the logical drive gets mapped correctly, it just doesn't convert the back slash to forward slash from within ksh.
Any thoughts?
Thanks!
|
|
|
RE: winpath2unix - Jun. 8, '04, 10:35:07 AM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
The backslash ("\") is the escape character meaning that the next character is to
be taken as a literal (unless your doing echo then it'll have special meaning).
You need to escape the escape character so it is taken literally ("\\").
This is true for all Unix shells.
So:
winpath2unix c:\\temp\\test\\testing\\test.txt
dev/fs/C/temp/test/testing/test.txt
|
|
|
RE: winpath2unix - Jun. 8, '04, 4:47:02 PM
|
|
|
tjones
Posts: 9
Joined: Jun. 4, '04,
Status: offline
|
I figured as much, but was just hoping for some 'magic' with winpath2unix when reading file names from an input file. So sed to add the second backslash and pipe it through winpath2unix...
|
|
|
RE: winpath2unix - Jun. 8, '04, 6:35:09 PM
|
|
|
markfunk
Posts: 673
Joined: Mar. 31, '03,
Status: offline
|
Or use single quotes, like
winpath2unix 'c:\tmp\foobar'
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
|
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|
|