今天晚上 用shell命令在每个字前面加$
把一个字符串存到变量中,然后使用sed命令在每个字前面加上$符号:
str="hello world"
echo $str | sed 's/\b/\$/g'
输出:
$hello $world
原文地址: https://www.cveoy.top/t/topic/cslU 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
把一个字符串存到变量中,然后使用sed命令在每个字前面加上$符号:
str="hello world"
echo $str | sed 's/\b/\$/g'
输出:
$hello $world
原文地址: https://www.cveoy.top/t/topic/cslU 著作权归作者所有。请勿转载和采集!