windows - 如何在 Windows 的 powershell 中使用 ack 在文件中搜索 '<'?

标签 windows powershell escaping ack

我不知道如何转义“<”字符,而且我对“系统找不到指定的文件”错误感到困惑。谁能帮忙?

我在 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/

相关文章:

.net - 如何使在该函数中可访问的函数中创建的 PSDrive 可用?

php - 存储用户提供的带有链接和格式的文本

javascript - 在 javascript dom 中,在 querySelector() 中转义字符

运行少量线程时 CPU 使用率达到 100%

c++ - 如 MSDN 所述,提供 SERVICE_STATUS_HANDLE (long unsigned int),函数需要 HANDLE (void*)

Powershell如何将csv文件中的数据添加到一列

mysql - 替换 MySQL 5 表中的反斜杠似乎有效 : but how do I double check?

windows - 使用 powershell 我想获取拥有域管理员权限的人员列表?

c++ - winldap 无法使用 ssl 连接到 openldap

powershell - 脚本正在输出一个额外的 0