From 4b0f8db3349f3117ef7fd150b2456bf34d59ec00 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 21 Jun 2017 19:40:43 +0200 Subject: [PATCH] fix --- asciiConvert.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/asciiConvert.sh b/asciiConvert.sh index 67bd794..aadd064 100755 --- a/asciiConvert.sh +++ b/asciiConvert.sh @@ -1,7 +1,15 @@ #!/bin/bash -: ${1?"Aufruf: $0 "} -while read line; do - escapedLine=$(echo $line | sed 's/\([$\"`]\)/\\\1/g') - echo "echo -e \"$escapedLine\"" -done < $1 +set -e + +format=$(echo ${1##*.}) +if [ $format != "jpg" ] +then +convert $1 /tmp/logo.jpg +else +cp $1 /tmp/logo.jpg +fi +jp2a --background=dark --invert --colors /tmp/logo.jpg --output=/tmp/logo.txt +while IFS= read -r line; do + echo "echo -e \"$line\"" +done < /tmp/logo.txt