- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 sed 中,使用分号分隔的多个命令是相当常见的:
$ sed -e '/re/{s//replace/p; q;}
但是,标准(例如 http://pubs.opengroup.org/onlinepubs/9699919799/ )只允许
换行符作为分隔符:
$ sed -e '/re/{
s//替换/p
q
}
是否有许多常见的 sed 实现仍在使用中不允许使用分号? IOW,打算可移植的 sed 脚本可以使用分号吗?
最佳答案
来自 the POSIX specification of sed
:
Command verbs other than {, a, b, c, i, r, t, w, :, and # can be followed by a
<semicolon>
, optional<blank>
characters, and another command verb. However, when the s command verb is used with the w flag, following it with another command in this manner produces undefined results.
/[^\{abcirtw:#];[[:space:]]*/
:-)
关于sed - 在 sed 中使用分号作为命令分隔符有多便携?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6280599/
很难说出这里问的是什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或言辞激烈,无法以目前的形式合理回答。如需帮助澄清此问题以便可以重新打开,visit the help center . 10年前关
我想做的是使 sbt 可移植,至少可以在不同的 Windows 机器之间移植,这样我的 sbt 插件、设置、ivy repo 等就不必在每台计算机上重新设置。 我的方法是把 sbt.bat , sbt
我似乎看到很多答案有人建议使用 生成随机数,通常伴随着这样的代码: std::random_device rd; std::mt19937 gen(rd()); std::uniform_int_d
我正在使用 perl(希望它不会影响任何东西),但我需要知道如何为连接操作设置超时。问题是我不能永远等待连接操作的发生。如果它没有在几秒钟内发生,我宁愿放弃并继续前进。 socket(my $sock
是否有一种简单、可移植的方式(至少是 win32,linux)将 UTF-16 转换为 UTF-8 并返回?最好使用 boost。 谢谢你的帮助,托拜厄斯 最佳答案 两者都是libiconv和 icu
我将飞往澳大利亚(飞行约 15 小时),我想在飞机上继续我当前的项目。 我的项目(CakePHP 框架上的网站)需要一个 LAMP 包,所以我正在寻找一种非常便携、价格合理的设备,可以安装 LAMP,
我想在我们的编程课上在我们学校的计算机(在 Windows 下)上运行 python3。我在家里(使用 Windows)将 python 3.1 安装到 USB 闪存驱动器上,并将其带到学校。但是,它
出于教学目的,我正在寻找适用于 Mac、Windows 和可能的 Linux 的独立 PHP 二进制文件。 计划将二进制文件作为单个文件分发给学生,用于测试 PHP 脚本,而无需安装完整的 Web 服
关于好的 Git GUI 的任何建议。理想情况下应具有以下特征: 没有太多限制,即可以支持相对复杂的功能,例如 rebase ,没有-ff 以“学习模式”显示正在执行的 Git 命令,尤其是具有很多选
我是一名优秀的程序员,十分优秀!