【发布时间】:2019-03-02 22:35:23
【问题描述】:
背景
我需要将 Perl 脚本从 Linux 移植到 Windows。脚本输出到标准输出并根据需要突出显示和下划线特定的单词。在 Linux 中,这可以通过使用对 tput 的系统调用将单词括起来来实现:
tput smso 和 tput rmso 用于突出显示
tput smul 和 tput rmul 用于下划线
问题
Windows 上是否有任何系统调用可以轻松完成此功能?如果没有,是否有人知道可以实现类似结果的解决方法?
【问题讨论】:
-
Write-Host 具有可用于突出显示的 -BackgroundColor 和 -ForegroundColor 参数。
标签: windows powershell perl cmd