Hacker News new | comments | show | ask | jobs | submit login

  ls -d * | entr make
Just a nit: this seems to be imperfect for filenames containing new lines (I know, I know). An xargs like -0, --null option could make it more robust. Then the equivalent of the above command would be something like:

  find . -maxdepth 1 -name '[!.]*' -print0 | entr -0 make
Edit: Seems like -print0 is not POSIX compliant. Is there any safe way to pass a list of paths using the shell in a fully POSIX compliant way?



Imperfect as well because any filename starting with a dash will be interpreted as an option to ls.

Nitpicking… or maybe not: if you take the habit of running `cmd * ` whatever the command, I guess you might end up writing dangerous things like `rm * ` in a script which will fatally end up running in a directory containing a file named “-R”.


On the other hand, since the target users are developers, they are in a good position to fix these newline-containing filenames. Even if they are POSIX compliant they shouldn't be encouraged :)


    printf '%s\0' * | xxd




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: