scratchpad
pKai
<code>Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\WINDOWS\system32>dir /temp
Parameterformat nicht korrekt - "emp".
C:\WINDOWS\system32>dir "/temp"
Datenträger in Laufwerk C: ist System
Volumeseriennummer: C40F-90D7
Verzeichnis von C:\temp
...
1 Datei(en) 29.406 Bytes
1 Verzeichnis(se), 3.351.207.936 Bytes frei
C:\WINDOWS\system32>cd /temp
Das System kann den angegebenen Pfad nicht finden.
C:\WINDOWS\system32>cd "/temp"
Das System kann den angegebenen Pfad nicht finden.
C:\WINDOWS\system32>cd "c:/temp"
Das System kann den angegebenen Pfad nicht finden.
C:\WINDOWS\system32>cd "../../temp"
C:\temp></code>
<hr/>
<h1><a name="ForIntrepid">For Intrepid, wrt "usespipe":</a></h1>
<p>The code</p>
<code>
doskey usespipe=set ^| perl -npe "s/^/|/"
</code>
<p><small>(Changed: Caret is not special inside quotes.)</small></p>
<p>was a reply to your homenode's chapter headed <b>"For MSWin-user Monks"</b></p>
<p>You have some informations on using <tt>doskey</tt> there, and you give the caveat</p>
<blockquote>
<ul><li>It is apparently not possible to use a pipe symbol (not || but | ) in the Perl code. If anyone finds out otherwise then let me know.</li></ul>
</blockquote>
<p>My doskey macro definition above uses the pipe inside the perl code (no problem anyway since it's quoted), and outside in the plain command definition.</p>
<p>For the latter, the pipe has to be escaped (^). That was the whole point of my message.</p>
<!--p>Refering to [href://?node=Intrepid#msw-metafolders|msw-metafolders], last paragraph.</p>
<p>While it is true that newlines cannot be part of a quoted string, multi-line commands can be built with the caret (^) escape . Outside of quotes this escapes the next character, also newlines.</p>
<p>So by splitting your 1-liner script to 3 <tt>-e</tt> parts, you can do:<p>
<code>
perl -MWin32 -e "my @ds=grep {/CSIDL_/} @{ [keys %Win32::] }; " ^
-e "do {printf qq/%31s => %s\n/, $_, Win32::GetFolderPath(&{$Win32::{$_}}) }" ^
-e "for map { $_->[0] } sort {$a->[1] <=> $b->[1]} map { [$_,&{$Win32::{$_}}] } @ds"
</code>
<p>Not really helpfull here, but it can be done.</p--><hr/>