开发者

text manipulation in shellscript

I want to ad开发者_高级运维d a dot to all lines that doesn't start with a dot. How can I do this in shellscript? should I use sed?

example file:
.a
a
b
.c

turns to

.a
.a
.b
.c


You can use sed:

sed -i '/^[^.]/s/^/./' text_file
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜