我不知道如何转义“<”字符,而且我对“系统找不到指定的文件”错误感到困惑。谁能帮忙?
我在 Windows XP 的 powershell 中使用 ack。
问题ack-grep: chars escaping与我的非常相似,但针对该问题提供和接受的解决方案对我不起作用。
PS C:\xampp\htdocs> ack abcd
<works as expected>
PS C:\xampp\htdocs> ack <
The redirection operator '<' is not supported yet.
At line:1 char:5
+ ack < <<<<
PS C:\xampp\htdocs> ack \<
The syntax of the command is incorrect.
PS C:\xampp\htdocs> ack '<'
The syntax of the command is incorrect.
PS C:\xampp\htdocs> ack '\<'
The syntax of the command is incorrect.
PS C:\xampp\htdocs> ack [<]
The system cannot find the file specified.
PS C:\xampp\htdocs> ack '[<]'
The system cannot find the file specified.
PS C:\xampp\htdocs> ack '[\<]'
The system cannot find the file specified.
PS C:\xampp\htdocs> ack \Q<\E
The system cannot find the file specified.
最佳答案
您有什么理由不想使用 PowerShell 的正则表达式搜索吗?
Select-String '<' *.*
## or
dir -r | Select-String '<'
关于windows - 如何在 Windows 的 powershell 中使用 ack 在文件中搜索 '<'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6869636/