Bash: Changing a specific line in a file, to something which includes the line -


i'm trying change file this:

hello name [bob] age 34 

should turn into:

hello name [bob]sometext[bob]sometext age 34 

however, make easier, know 'string' i'm looking start [bo

any appreciated, if need more info, :)

if don't need use bash only, can use sed:

 sed 's/\[bo.*/&sometext&sometext/g' filename 

output:

hello name [bob]sometext[bob]sometext age 34 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -