Hi,

Die Optimisten wrote:
> > How can I escape a ' inside '...'
> > e.g. perl -e 'print '$ and a' '

Mark Fletcher wrote:
> perl -e 'print '\''$ and a'\'' '

Or by ending the range of ' and packing the literal ' into
double quotes:

  perl -e 'print '"'"'$ and a'"'"' '

consisting of these quotation pieces

  'print '
  "'"
  '$ and a'
  "'"
  ' '

If there was no $ in the text, one could do it more simply by
packing the whole text into double quotes:

  perl -e "print '$ and a' "


Have a nice day :)

Thomas

Reply via email to