aboutsummaryrefslogtreecommitdiff
path: root/Test/03quoting.ztst
blob: 6cf86e10fdb9b3036a37e3882904f6baf54a5dbe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
%test
  print 'single  quotes'  "double  quotes"  `echo backquotes`
0:Simple use of quotes
>single  quotes double  quotes backquotes

  foo=text
  print -r '$foo\\\' "$foo\$foo\\\"\``echo bar`\`\"" `print -r $foo\\\``
0:Quoting inside quotes
>$foo\\\ text$foo\"`bar`" text`

  print -r $'\'ut queant laxis\'\n"resonare fibris"'
0:$'-style quotes
>'ut queant laxis'
>"resonare fibris"

  print -r ''''
  setopt rcquotes
# We need to set rcquotes here for the next example since it is
# needed while parsing.
0:No RC_QUOTES with single quotes
>

  print -r ''''
  unsetopt rcquotes
0:Yes RC_QUOTES with single quotes
>'