The code works in Ubuntu, but not in OSX.

I run

perl -000pe 's/\n/\n\\begin{enumerate}\n/; s/\n\d./\n\\item /g; s/$/\\end{enumerate}\n/' lorem.tex

I get

-bash: $: command not found
MacBook-Air:draft masi$ 
  • 2
    On perl 5 v12 I'v no problems with your script. – Matthieu Riegler Jun 5 '14 at 9:16
  • What does perl -v give? – user151019 Jun 5 '14 at 9:34
  • @Mark "This is perl 5, version 16, subversion 2 (v5.16.2) built for darwin-thread-multi-2level". – Léo Léopold Hertz 준영 Jun 5 '14 at 10:39
  • Your shell prompt chanegs what are $PS1 and $PS2 ? – user151019 Jun 5 '14 at 11:07
  • @Mark echo $PS1: \h:\W \u\$. echo $PS2: > (only arrow). – Léo Léopold Hertz 준영 Jun 5 '14 at 11:35

It seems like you might have cut-n-pasted the command in to the shell in some odd way - or you manually entered it in the wrong way.

Try again, and this time pay attention to the quote characters. You need to use the right apostrophes. Make sure you don't use backticks or similar.

  • This is strange. I paste the same thing to my Zsh prompt and everything works. I paste the thing to Bash prompt and I get this error. I think Zsh understands those marks (',") more extended. – Léo Léopold Hertz 준영 Jun 5 '14 at 16:06
  • 1
    It's not more strange than it works when I paste it in my bash shell. You need to check those quotation marks when you paste it in. Try typing it in instead! – jksoegaard Jun 5 '14 at 18:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .