Advertisement
h3xx

pastebin shell syntax bug

Oct 8th, 2011
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.50 KB | None | 0 0
  1. #!/bin/sh
  2. # the following is completely valid shell syntax
  3.  
  4. ## bug: quoted subshells ##
  5.  
  6. # broken up, this line is fine
  7. # (well, not really, but at least its errors are self-contained)
  8. temp="$(
  9.    mktemp -t "$(
  10.         basename -- "$0"
  11.     ).XXXXXX"
  12. )"
  13.  
  14. # but on a single line, it fucks up pastebin's syntax highlighting
  15. temp="$(mktemp -t "$(basename -- "$0").XXXXXX")"
  16. # see what I mean?
  17. # well?
  18.  
  19. # it only thinks it's outside a quoted string when I use a double quote --> "
  20. # now it's fine
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement