diff --git a/bash_quote b/bash_quote index d21daa2..b2bf6ae 100755 --- a/bash_quote +++ b/bash_quote @@ -1,8 +1,12 @@ -#! /bin/sh +#! /usr/bin/env sh # Description: Get a quot from http://danstonchat.com -lynx --dump --display_charset=utf8 http://danstonchat.com/random.html | awk '$4~"commentaires" && $0!~"RSS" { getline; while ($4!~"#") { print $0; getline;}; exit}' +if [ $(command -v lynx) ]; then + lynx --dump --display_charset=utf8 http://danstonchat.com/random.html | awk '$4~"commentaires" && $0!~"RSS" { getline; while ($4!~"#") { print $0; getline;}; exit}' +else + printf '%b' "Please install lynx package.\n" +fi #awk : chope les lignes où… #$1~"#" : le premier terme ($1) contient un dièse