dollar_repl_slash_bash1.tests 536 B

123456789101112131415161718192021
  1. # The bug here was triggered by:
  2. # * performing pathname expansion because we see [
  3. # * replace operator did not escape \ in replace string
  4. IP=192.168.0.1
  5. rm -f '192.168.0.1['
  6. echo "${IP//./\\.}"
  7. echo "${IP//./\\.}"'[' # bug was here
  8. echo "${IP//./\\.}[" # bug was here
  9. echo "${IP//./\\\\.}[" # bug was here
  10. echo "192\.168\.0\.1["
  11. echo >'192.168.0.1['
  12. echo "${IP//./\\.}"
  13. echo "${IP//./\\.}"'[' # bug was here
  14. echo "${IP//./\\.}[" # bug was here
  15. echo "${IP//./\\\\.}[" # bug was here
  16. echo "192\.168\.0\.1["
  17. rm -f '192.168.0.1['