shell-scripte-code/asciiConvert.sh

16 lines
282 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
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