sentakuitaの日記: [/.Jプログラミング部]bindate.sh(2)
別ver
使い方は謎
$ bindate2
□□□□□■
□□□□■□
□□■■□□
□□■□■□
こんなjpgファイル吐く。
----
#!/bin/bash
xbm_file=bindate.xbm
jpg_file=bindate.jpg
echo '#define bindate_width 4'>$xbm_file
echo '#define bindate_height 6'>>$xbm_file
echo 'static char bindate_bits[] = {'>>$xbm_file
date '+%H%M%S' |sed -e 's/\(.\)/\1,/g'>>$xbm_file
echo '};'>>$xbm_file
convert -scale 1000% -rotate -90 $xbm_file $jpg_file
ee $jpg_file
----
中間ファイル不要に改造。
----
#!/bin/bash
echo -e "#define bindate_width 4\n\
#define bindate_height 6\n\
static char bindate_bits[] = {\n\
"`date '+%H%M%S' |sed -e 's/\(.\)/\1,/g'`"\n\
};" \
|convert -scale 1000% -rotate -90 xbm:- jpg:- |display -
----
無理矢理ワンライナー
----
$ echo -e "#define b_width 4\n#define b_height 6\nstatic char b_bits[] = {\n"`date '+%H%M%S' |sed -e 's/\(.\)/\1,/g'`"\n};"|convert -scale 40 -rotate 270 - - |display -
[/.Jプログラミング部]bindate.sh(2) More ログイン