How to use single quotes in a perl one-liner

published Jun 14, 2013 01:23   by admin ( last modified Jun 14, 2013 01:23 )

Use the octal form, i.e. \047 .

 

echo "a,b" | perl -F',' -lane 'print "$F[0]\047";' a'


Read more: Link - shell - Perl one-liner with single quote - Stack Overflow