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
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
精彩评论