From 20d9f76bed53003f94669fbf6b9ab97758ce2288 Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Thu, 15 Nov 2018 17:56:44 +0900 Subject: [PATCH] Add safe_cowsay --- shrc | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/shrc b/shrc index be4d84f..57b23a9 100755 --- a/shrc +++ b/shrc @@ -190,25 +190,23 @@ then else alias __safe_lolcat=cat fi +if command -v cowsay >/dev/null +then + alias __safe_cowsay=cowsay +else + alias __safe_cowsay=cat +fi command -v fortune >/dev/null && { - if command -v cowsay >/dev/null - then - fortune | cowsay | __safe_lolcat - echo - fortune -o | cowsay | __safe_lolcat - echo - else - fortune | __safe_lolcat - echo - fortune -o | __safe_lolcat - echo - fi + fortune | __safe_cowsay | __safe_lolcat + echo + fortune -o | __safe_cowsay | __safe_lolcat + echo } if null type figlet && null type lolcat then - hostname -s | figlet | lolcat + echo `whoami`@`hostname` | figlet | lolcat fi uname -a