From 18224ba566035edd8a7cdd754b6c5052d3a2642d Mon Sep 17 00:00:00 2001 From: Gardouille Date: Tue, 8 Sep 2015 02:14:15 +0200 Subject: [PATCH] bash_quote: correct shebang and check if lynx is available. --- bash_quote | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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