Add example to Unix post.
authorOlof-Joachim Frahm <olof@macrolet.net>
Wed, 11 Nov 2015 14:21:22 +0000 (15:21 +0100)
committerOlof-Joachim Frahm <olof@macrolet.net>
Wed, 11 Nov 2015 14:21:22 +0000 (15:21 +0100)
limits-of-unix.post

index 56f8a07..f214b74 100644 (file)
@@ -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).