문제

I use W7 64bit and I just installed strawberry perl. I need to execute a simple script from windows command line for manipulation of text files:

perl -ne 'chomp; print "$_ O O O O\n"' test.txt > textformatted.txt

I get error:

Can't find string terminator "'" anywhere before EOF at -e line 1.

It's in the PATH and also I can call perl -v. I tried adding spaces, replacing ' with ", backslashs etc. but no use.

I looked at tutorials and searched on the web and I found a lot of statements like this so it seems that this statement should work. But it doesn't.

Can somebody please help me? Where is the mistake?

도움이 되었습니까?

해결책

You need to change your single quotes to double quotes.

perl -ne "chomp; print qq($_ O O O O\n)" test.txt > textformatted.txt
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top