Reputation: 271764
In my directory, I want to run the script. The script should take all .js files (and recursively as well), and merge them together into 1 file and spit out that file.
How can I write this script?
Upvotes: 0
Views: 860
Reputation: 25599
if you have Ruby(1.9+)
ruby -e 'BEGIN{o=open("out","w")};Dir["**/*.js"].each{|x|o.write(open(x).read()+"\n")};END{o.close()}'
Upvotes: 0