zsh为模式替换指定多个字符

时间:2015-11-05 15:03:46

标签: zsh

print Contact\ us,\ Blog/(:l:gs/ /-)

结果如下:

contact-us,-blog

如何更改,

我试过了:

print Contact\ us,\ Blog/(:l:gs/ ,/-)
print Contact\ us,\ Blog/(:l:gs/[ ,]/-)

没有成功。

编辑: 我看到它使用字符序列作为要替换的字符串,所以这里没有模式。 有没有比在序列中使用多个:gs更好的方法,当然不使用像sed这样的外部命令?

0 个答案:

没有答案
相关问题