Make taocl() more robust

Thanks to #533 @ResponSySS and @pr4j
This commit is contained in:
Joshua Levy 2017-11-28 14:00:14 -08:00 committed by GitHub
parent 3868fc2291
commit 72c71cd2b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -376,10 +376,11 @@ A few examples of piecing together commands:
```sh ```sh
function taocl() { function taocl() {
curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md | curl -s https://raw.githubusercontent.com/jlevy/the-art-of-command-line/master/README.md |
sed '/cowsay[.]png/d' |
pandoc -f markdown -t html | pandoc -f markdown -t html |
xmlstarlet fo --html --dropdtd | xmlstarlet fo --html --dropdtd |
xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" | xmlstarlet sel -t -v "(html/body/ul/li[count(p)>0])[$RANDOM mod last()+1]" |
xmlstarlet unesc | fmt -80 xmlstarlet unesc | fmt -80 | iconv -t US
} }
``` ```