Shell字符串转义

 

Here’s the table of contents:

  1. 单引号转义
  2. 单引号括号转义
  3. HTTP请求执行Cypher

单引号转义

  • 脚本
    echo 'RETURN '\'\hello\'' AS str'
    
  • 输出
    RETURN 'hello' AS str
    

单引号括号转义

  • 脚本
    echo 'RETURN '\'\(\hello\)\'' AS str'
    
  • 输出
    RETURN '(hello)' AS str
    

HTTP请求执行Cypher

  curl -u ongdb:testlab%pro -d '{"statements": [{"statement": "RETURN '\'\(\hello\)\'' AS str","resultDataContents": ["row","graph"]}]}' -H 'Content-Type: application/json' -X POST http://10.20.13.200/db/data/transaction/commit