Currently, I am in the process of merging my CSS and JS files before minifying them with the YUI compressor. My web application functions perfectly when each file is linked individually.
Now, I am attempting to combine all the files into one single CSS file using the command:
find /myapp/js/ -type f -name "incl_*.js" -exec cat {} + > ./temporary/js_backend_merged.js
This successfully merges all my javascript files. However, when I perform this action on my CentOS server, my JS begins to display errors. The same issue occurs when merging CSS files - they do not render correctly on the CentOS server but work fine when merged on my MAC.
Interestingly, I have executed the same merging process flawlessly on a previous CentOS server without any issues.
I suspect that the problem may be related to a character set discrepancy on the server. Can anyone help me solve this perplexing mystery that has already consumed two full days of my time?
UPDATE: It seems that the command find /myapp/js/ -type f -name "incl_*.js" -exec cat {} + > ./temporary/js_backend_merged.js arranges the files from incl_01 to incl_02, etc., correctly on the mac. However, the order is different on the server.
Although I see that using sort -n can sort the results, I am unable to integrate this sorting option successfully into the above command.