【发布时间】:2021-01-12 02:49:56
【问题描述】:
在 Linux Bash 脚本中
-
/bin/sh等价于/bin//sh -
e\tc转换为etc -
\'转换为' -
"b"转换为b -
'in'转换为in
将任何字符串转换为其“bash 等效项”的确切方法是什么? (最好在 python 中)
例如以/"b"'i'n///\s"h" 转换为/bin/sh 如下所示:
r3t@r3t:~/$ /"b"'i'n///\s"h"
$
【问题讨论】:
-
//仅在路径中等效于/,在其他情况下则不然。
标签: python linux string shell scripting