3 ms·
Pretty cool. But as everyone is pointing out, empty files aren't that interesting. 31/137. $ find . -name ".git" -prune -o -name "README.md" -prune -o -typ
by ks2048 1y ago
Pretty cool. But as everyone is pointing out, empty files aren't that interesting. 31/137.
$ find . -name ".git" -prune -o -name "README.md" -prune -o -type f -print | wc -l
137
$ find . -name ".git" -prune -o -name "README.md" -prune -o -type f -empty -print | wc -l
31
I suppose if you wanted minimal, non-empty examples, you'd end up with a "hello, world" collection, of which there are many, but nice that this handles file formats as well as programming languages.
- aidenn0 1y agoThe traditional minimal bourne-like shell script has a single ":" in it. This is because, when looking at an executable[1], bourne-alikes may try to detect if the file is binary to prevent executing a binary file. I don't know for a fact that some sh implementations will refuse to execute an empty file, but it seems likely. 1: If you try to run a program binary from a bourne-like shell and execl() signals ENOEXEC, then (if it believes it to be a text file) it will try to run it as a shell script; this makes shebangs optional for programs executed only from a shell. You can try it yourself (tested on bash, dash, ksh, fish, zsh, and osh): $ echo 'echo hi' > foo.sh $ chmod +x foo.sh $ ./foo.sh