bash - Adding text to a bunch of files -


i needed append text bunch of files in directory, thought i'd clever , try this:

find . -name "*.txt" -exec cat source >> {} \; 

which did not work, of course, because redirect gets picked shell calling find, , not exec.

i ended using bbedit , multi-file find/replace it, sure there's way make find command line, what?

well, ok, can think of 1 solution, don't it: have exec spawn shell each result. might work.

what :

find . -name "*.txt" -exec dd if=source of='{}' oflag=append conv=notrunc ';' 

you should able use files spaces , special characters.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -