![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest
Posts: n/a
| 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 |
| | #2 (permalink) |
| Guest
Posts: n/a
| 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 |
| | #3 (permalink) |
| Guest
Posts: n/a
| 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 |
| | #4 (permalink) |
| Guest
Posts: n/a
| 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 |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problems with $var | select-string -pattern $string -q | Ben Christian | PowerShell | 3 | 02-08-2008 12:41 PM |
| Re: select-string exceptions | cmyers | PowerShell | 0 | 05-23-2007 02:10 PM |
| Re: select-string exceptions | cmyers | PowerShell | 0 | 05-23-2007 02:09 PM |
| select-string to act like grep -v | Frank | PowerShell | 5 | 05-12-2007 12:59 AM |
| Select-String problem with not English ASCII text | Roman Kuzmin | PowerShell | 11 | 01-16-2007 08:34 PM |