in reply to Road to a readable path
On Windows, you don't even need Perl to get a readable path:
for %i in ("%path:;=" "%") do @echo %i
Produces this (for my path):
{C} > for %i in ("%path:;=" "%") do @echo %i "C:\usr\bin" "C:\Perl\bin" "C:\WINDOWS\system32" "C:\WINDOWS" "C:\WINDOWS\System32\Wbem" "c:\Program Files\Microsoft SQL Server\90\Tools\binn\" "C:\Documents and Settings\Administrator\My Documents\bin" {C} >
UPDATE: Use "set /?" at the command prompt to find out the new options for environment variable substitution (the %path:;=" "%). Basically, I wrap the %PATH% ENV var in double quotes and then replace all the semicolon separators with a double-quote, space, double quote. This effecitely puts double quotes around all the paths (so spaces won't give any troubles) and we use the for loop to list each newly double-quoted string
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Road to a readable path (unix, non-perl)
by toolic (Bishop) on Apr 15, 2009 at 14:07 UTC | |
by Daenyth (Novice) on Jun 02, 2009 at 19:02 UTC | |
by parv (Parson) on Jun 03, 2009 at 10:37 UTC | |
|
Re^2: Road to a readable path
by Burak (Chaplain) on May 11, 2009 at 21:10 UTC |