我正在尝试使用此命令从命令行在 vim 中打开多个文件。出于某种原因,我遇到了错误,如下所示。
$ find . -name edit.html.erb \
| perl -pi -e 's/^..//' \
| perl -pi -e 's/\n$/ /' \
| vim
当我在没有“| vim”的情况下运行它时,如下命令:
$ find . -name edit.html.erb \
| perl -pi -e 's/^..//' \
| perl -pi -e 's/\n$/ /'
并得到这个输出:
addresses/edit.html.erb claims/edit.html.erb emails/edit.html.erb owners/edit.html.erb packages/edit.html.erb users/edit.html.erb vessels/edit.html.erb voyages/edit.html.erb %
我收到一个错误,可能与输出末尾的“%”标记有关。
这是输出和错误:
Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...
Vim: preserving files...
Vim: Finished.
我怎样才能解决这个问题?由于我是新手,因此不确定是哪个部分导致了错误,但我们将不胜感激!