X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=limits-of-unix.post;fp=limits-of-unix.post;h=f214b74357bf4f5713a2a12182bf8720436d37d3;hb=1802188e56e19ca1afb9ea748f45b00a07ffb938;hp=56f8a07c26089449552093ad48fa3c18efccd892;hpb=324201782f133211d92c1ff4a00c2f159ee85fc0;p=blog.git diff --git a/limits-of-unix.post b/limits-of-unix.post index 56f8a07..f214b74 100644 --- a/limits-of-unix.post +++ b/limits-of-unix.post @@ -40,7 +40,14 @@ immediately, instead of rerunning the whole pipeline. E.g. coming from Common Lisp, variables like `*` to `***` will store the last three results for interactive use. In the shell then, `ls` would set `*` to the generated directory listing; since the listing is also most likely printed to the screen, -the full listing will also be stored (in that object) to be used again if e.g. `*` -is requested again. Rerunning the command, on the other hand, will possibly -generate a different directory listing as files may have been changed, so there -*is* an immediate difference between the two forms. +the full listing will also be stored (in that object) to be used again if e.g. +`*` is requested again. Rerunning the command, on the other hand, will +possibly generate a different directory listing as files may have been changed, +so there *is* an immediate difference between the two forms. + +# Examples + +The pipeline `ls | wc -l` is (at least for me) often used to get the number of +files in the (current) directory. Unfortunately there is no direct way to get +this number directly except to enumerate the entries in a directory (under +Linux that is).