Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The first example

  "She said "you cant do this", didnt she?"
Parses the same way in Bash:

  $ for A in "She said "you can\'t do this\!", didn't she?"; do echo -$A-; done
  -She said you-
  -can't-
  -do-
  -this!, didn't she?-
So I'd have thought this would be a given. It doesn't look so unintuitive – though I'm not sure if the results are the same for the same reasons.

So I went to take a look at the Bash source code. Which is (expectedly) pretty hairy. Top-of-stack quoting characters are referenced through-out, to enable a `pass_next_character` which seems to me similar conceptually to `ignore_special_chars`.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: