summaryrefslogtreecommitdiffstats
path: root/tests/nquote2.sub
blob: d3325f175dd3b8e42cd60c8a8b4d03fe6b3a22ca (plain)
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
27
28
29
t() {
    printf '%s  |  %s\n' "$1" "$2"
  }
  v="'"       # v <- '

  #--
  t "${v/$'\''/$'\''}"        "'"
  t  ${v/$'\''/$'\''}         "'"
  t "${v/$'\''/x}"            "x"
  t  ${v/$'\''/x}             "x"
  t "${v/x/$'\''}"            "'"
  t  ${v/x/$'\''}             "'"
  t "${v/x/$'\x5c\''}"        "'" 
  t  ${v/x/$'\x5c\''}         "'" 
  t "${v/\'/\'}"              "'"
  t  ${v/\'/\'}               "'"
  t  ${v/\'/x}               "x"

echo "'"
echo "$'\''"

echo $'\''

echo $'\'abcd\''
echo "$'\'abcd\''"

v=1
echo ${v/1/\'}
echo ${v/\'/2}