Pregunta

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?

¿Fue útil?

Solución

You need to change your single quotes to double quotes.

perl -ne "chomp; print qq($_ O O O O\n)" test.txt > textformatted.txt
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top