From: Olof-Joachim Frahm Date: Wed, 11 Nov 2015 14:21:22 +0000 (+0100) Subject: Add example to Unix post. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=1802188e56e19ca1afb9ea748f45b00a07ffb938;p=blog.git Add example to Unix post. --- 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).