2 of 2
`$'...'` is a ksh feature now also supported by zsh and bash. Missing quotes
Stéphane Chazelas
  • 532.9k
  • 92
  • 1026
  • 1527

If you are using, ksh93, zsh or bash, you can use the $'...' ksh-extension, which does C-style backslash escape interpretation inside the quoted string:

csplit --silent --prefix=email-emailbad.txt- --digits=3 \
       emailbad.txt $'/^\.\r/+1' '{*}'

Otherwise, you can use printf to create the string, in a very similar way:

csplit --silent --prefix=email-emailbad.txt- --digits=3 \
       emailbad.txt "$(printf '/^\.\r/+1')" '{*}'
rici
  • 9.7k
  • 1
  • 38
  • 38