Escape filenames the same way Bash does it

后端 未结 6 1414
攒了一身酷
攒了一身酷 2020-11-30 06:14

When I use the \"tab\" key in bash (when you have started to type the filename and you want it to complete), bash escapes the filename correctly, a

6条回答
  •  醉酒成梦
    2020-11-30 06:43

    ls  --quoting-style=escape /somedir
    

    this will output the escaped filenames, and also work with unicode characters, printf method does not work with Chinese, it outputs something like $'\206\305...'

提交回复
热议问题