Marcin
Marcin

Reputation: 3

Sed command inside perl script doesn't work

I have a problem with a sed command located inside my perl script. 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? 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.

Upvotes: 0

Views: 1150

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207455

You probably want a "-e" after the "sed" at least. And a "\" before the "$".

Upvotes: 2

Related Questions