Quote:
Originally Posted by MadeInGermany
That is because by default $_ ends with a newline character, and print does not print an ending newline character.
You can change both behaviors with the -l option.
Code:
ls *.ts | perl -lne 'print "\"file $_\""'
Where I think it makes more sense to put the escaped quotes around the $_
In fact perl -lne has the most in common with awk. Even BEGIN and END sections work if you wrap the main/loop section in braces.
|
Perfect
Code:
/TEST$ ls *.ts | perl -lne 'print "\"file $_\""'
"file 167275.ts"
"file 361879.ts"
"file 445115.ts"
"file 462757.ts"
"file 514423.ts"
"file 612203.ts"
"file 617537.ts"
"file 654815.ts"
"file 725775.ts"
"file 759838.ts"
"file 844680.ts"
"file 942393.ts"
thanks everyone