如果要过滤文件,但如果我使用相同的文件作为输入和输出,则输出文件为空。是否有另一种解决方案而不是使用第二个文件?
php -r "echo preg_replace('~/\* DEV \*/(.*)/\* ENDDEV \*/~si', '', file_get_contents('php://stdin'));" < build/index.php > build/index.php
linux shell command-line stdout stdin
command-line ×1
linux ×1
shell ×1
stdin ×1
stdout ×1