Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to read a file and add in each line a "#"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
SarahS93
Guru
Guru


Joined: 21 Nov 2013
Posts: 342

PostPosted: Sun Jul 31, 2016 7:36 pm    Post subject: How to read a file and add in each line a "#" Reply with quote

With which command/programm can i read a file and add in the beginning of earch line "# " and write this file than?!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 9860

PostPosted: Sun Jul 31, 2016 7:58 pm    Post subject: Reply with quote

You could use sed -i -e 's/^/#/' list-of-files.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum