Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在 Perl 中编写 System V 初始化脚本(通常存储在 中/etc/init.d并运行的脚本service),并让 shell 识别#!/usr/bin/perl?这样做会有什么坏处吗?
/etc/init.d
service
#!/usr/bin/perl
脚本本身可以用任何语言编写,但支持工具可能需要解析脚本以获取决定 initscript 何时启动/停止所需的元数据。这将选择限制为可以以工具接受的形式提供此元数据的选择。
此外,可能有一些外部文件用 shell 脚本编写,initscript 需要这些文件才能正确/高效/有效地运行。除非这些文件非常简单,否则任何用于读取它们的解析器都可能变得非常复杂。