Tag Info

Hot answers tagged


I think the thing to do is have your php/python return the data directly instead of apache. Your code can do the same thing that apache does. In my experience this is much better than opening up another directory and/or using sudo, or changing file permissions for apache, etc. If the program produces the large file faster than the internet connection, ...


for i in {1..5}; do php phpfiletoexecute.php; done This is the stupidest possible version; given more information, you could do things like check if each run succeeded, look at their output if any, and so forth.


To avoid a loop, you can use xargs: ls * | xargs -I{} php -l {} It wouldn't work for files with newlines in their names.


Your shell globbing was (most likely) succeeding, and was passing the files to php -l, but php -l only processes one file at a time (ref). One of the shortest (not bullet-proof) ideas I have: for f in *; do php -l "$f"; done Modify the * to be *.js or whatever other extension you might use. For multiple extensions, just pile them in: for f in *.js *.inc ...

Only top voted, non community-wiki answers of a minimum length are eligible