LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to add an empty line in hundreds of files (https://www.linuxquestions.org/questions/linux-general-1/how-to-add-an-empty-line-in-hundreds-of-files-512446/)

edenCC 12-20-2006 11:21 PM

how to add an empty line in hundreds of files
 
HI,list;
how can i add a new empty line in the end of hundreds of files?
I've tried this, but it seems not work..
find . -type f -name *.h -exec echo >>{} \;

carl0ski 12-20-2006 11:38 PM

what language?

i only know bash

for file in `ls`; do echo -e "\n" >> $file; done

this adds a blank line to the end of all files in your current directory

edenCC 12-21-2006 12:06 AM

Quote:

Originally Posted by carl0ski
what language?

i only know bash

for file in `ls`; do echo -e "\n" >> $file; done

this adds a blank line to the end of all files in your current directory

finally,I also use this way :cool:
but I want to know how to do this only use find.


All times are GMT -5. The time now is 10:36 AM.