I have a directory with several *.js files. Quantity and file names are unknown. Something like this:
js/
|- 1.js
|- 2.js
|- blabla.js
I need to merge all the files in this directory into one merged_dmYHis.js. For example, if files contents are:
1.js
aaa
bbb
2.js
ccc
ddd
eee
blabla.js
fff
The merged_280120111257.js would contain:
aaa
bbb
ccc
ddd
eee
fff
Is there a way to do it using bash, or such task requires higher level programming language, like python or similar?
general solution would be:
Just out of interest – do you think it is a good idea to name the files with DDMMYYYYHHMM? It may be difficult to sort the files chronologically (within the shell). How about the YYYYMMDDHHMM pattern?