[other_os] Unix | How to comment all the lines of a file having a specific string

view story

http://ubuntuforums.org – Hi All, I have a file like this red 12345 12345 abc red ddd red dfgd abc blue 123 123 red123 123red123 I need to comment all lines from this file containing the string 'red'. Desired output. #red 12345 #12345 abc red #ddd red dfgd abc blue 123 #123 red123 #123red123 How to achive this in Unix?? Thanks, sarin (Hardware)