![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Select-String problem I'm bummed that Select-String is failing me here: 224# Select-String '^Test' '\\machine\c\Program Files\Acme\Wino\Output\output1.txt' Select-String : The file can not be read: \\machine\c\Program Files\Acme\Wino\Output\output1.txt At line:1 char:14 + Select-String <<<< '^Test' '\\machine\c\Program Files\Acme\Wino\Output\output1.txt' But my trusty old MKS grep.exe works: 225# grep.exe -i '^Test' '\\machine\c\Program Files\Acme\Wino\Output\output1.txt' | measure Count : 184 Argh! That's just wrong! I want to get rid of MKS (eventually). So is the problem related to the UNC path or the fact that the file is actively being written to? I'm guessing it is the latter. Perhaps select-string is opening the file in a naughty way? -- Keith |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Select-String problem On 2007-06-12 01:58:55 +0100, "Keith Hill [MVP]" <r_keith_hill@no.spam.thank.u.hotmail.com> said: > I'm bummed that Select-String is failing me here: > > 224# Select-String '^Test' '\\machine\c\Program > Files\Acme\Wino\Output\output1.txt' > Select-String : The file can not be read: \\machine\c\Program > Files\Acme\Wino\Output\output1.txt > At line:1 char:14 > + Select-String <<<< '^Test' '\\machine\c\Program > Files\Acme\Wino\Output\output1.txt' > > But my trusty old MKS grep.exe works: > > 225# grep.exe -i '^Test' '\\machine\c\Program > Files\Acme\Wino\Output\output1.txt' | measure > > > Count : 184 > > Argh! That's just wrong! I want to get rid of MKS (eventually). So > is the problem related to the UNC path or the fact that the file is > actively being written to? I'm guessing it is the latter. Perhaps > select-string is opening the file in a naughty way? is the c share hidden? '\\machine\c$\pathtofile' n |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Select-String problem "Neil Chambers" <n3llyb0y@aol.com> wrote in message news:2007061320020243658-n3llyb0y@aolcom..." > > is the c share hidden? '\\machine\c$\pathtofile' > No there is a "C" share with read access. The MKS tail.exe utility can read from that share just fine as can PowerShell. -- Keith |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Select-String problem "Keith Hill [MVP]" <r_keith_hill@mailhot.nospamIdotcom> wrote in message news:7EE7E726-6B96-46E2-8FED-44EC34ABDD03@microsoft.com... > "Neil Chambers" <n3llyb0y@aol.com> wrote in message > news:2007061320020243658-n3llyb0y@aolcom..." >> >> is the c share hidden? '\\machine\c$\pathtofile' >> > > No there is a "C" share with read access. The MKS tail.exe utility can > read from that share just fine as can PowerShell. Oops, I meant the MKS grep.exe utility. Tailing files that PowerShell is writing to is yet another issue. -- Keith |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Select-String -exclude | PowerShell | |||
| select-string issue | PowerShell | |||
| problems with $var | select-string -pattern $string -q | PowerShell | |||
| Re: select-string exceptions | PowerShell | |||
| Select-String problem with not English ASCII text | PowerShell | |||