Add a script to get a quote from danstonchat (dtc, bashfr, ...).

This commit is contained in:
gardouille 2014-09-26 00:19:23 +02:00
parent 733983417e
commit 2de4d35c3e
1 changed files with 16 additions and 0 deletions

16
bash_quote Executable file
View File

@ -0,0 +1,16 @@
#! /bin/sh
# Description: Get a quot from http://danstonchat.com
lynx --dump --display_charset=utf8 http://danstonchat.com/random.html | awk '$1~"commentaires" && $0!~"RSS" { getline; while ($1!~"#") { print $0; getline;}; exit}'
#awk : chope les lignes où…
#$1~"#" : le premier terme ($1) contient un dièse
#&& : ET
#$0!~"RSS" : la ligne entière ($0) ne contient pas RSS
#{ : fait…
#getline; : chope la ligne suivante
#while ($1!~"#") : tant que le premier terme ne contient pas de dièse…
#{ print $0; getline;}; : affiche la ligne entière
#exit : quitte (on veut une seule quote)
#}