简体   繁体   English

perl脚本中的sed命令不起作用

[英]Sed command inside perl script doesn't work

I have a problem with a sed command located inside my perl script. 我的perl脚本中有一个sed命令有问题。 When I execute the script I have following error: 当我执行脚本时,我有以下错误:

sed: -e expression #1, char 6: unterminated `s' command

It concerns the line below: 它涉及以下行:

$com1=`ls $path_correct | cut -f 1 -d "." | sed "s/.\{2\}$//" | sort > /tmp/usf-rpms`;

Why perl doesn't understand sed? 为什么perl不懂sed? What should be the correct syntax. 什么应该是正确的语法。 I have tried deal with problem for few days but have no ideas to resolve the issue. 我已经尝试了几天处理问题但没有解决问题的想法。 Please help. 请帮忙。

You probably want a "-e" after the "sed" at least. 至少在“sed”之后你可能想要一个“-e”。 And a "\\" before the "$". 和“$”之前的“\\”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM