shell-scripte-code/asciiConvert.sh

16 lines
285 B
Bash
Raw Normal View History

2017-06-21 17:43:26 +02:00
#!/bin/bash
2017-06-21 19:40:43 +02:00
set -e
format=$(echo ${1##*.})
if [ $format != "jpg" ]
then
2018-11-11 04:24:37 +01:00
convert $1 /tmp/logo.jpg
2017-06-21 19:40:43 +02:00
else
2018-11-11 04:24:37 +01:00
cp $1 /tmp/logo.jpg
fi
2017-06-21 20:16:27 +02:00
jp2a $2 --background=dark --colors /tmp/logo.jpg --output=/tmp/logo.txt
2017-06-21 19:40:43 +02:00
while IFS= read -r line; do
2018-11-11 04:24:37 +01:00
echo "echo -e \"$line\""
2017-06-21 19:40:43 +02:00
done < /tmp/logo.txt