]> git.eshelyaron.com Git - emacs.git/commitdiff
Port and simplify example sh script
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 21 Mar 2017 16:18:42 +0000 (09:18 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 21 Mar 2017 16:19:42 +0000 (09:19 -0700)
* doc/misc/org.texi (noweb-ref): Simplify shell script example and
don’t use ‘tail -1’, which is not portable.

doc/misc/org.texi

index 21c8758b8029466651a0017f7dfedc5b1b56a54e..fca5185337eba9a8e73ad752cf88703038b3ea1a 100644 (file)
@@ -15327,14 +15327,9 @@ inheritance}).}.
    |sed '1d' \
  #+END_SRC
 
- ** sort by the percent full
+ ** output mount point of fullest disk
  #+BEGIN_SRC sh
-   |awk '@{print $5 " " $6@}'|sort -n |tail -1 \
- #+END_SRC
-
- ** extract the mount point
- #+BEGIN_SRC sh
-   |awk '@{print $2@}'
+   |awk '@{if (u < +$5) @{u = +$5; m = $6@}@} END @{print m@}'
  #+END_SRC
 @end example