Quoth FRIGN: > Here's my version: > > content=`cat $1` > if [ ${content:0:9} = "imageRGBA" ]; then > w=${content:10:9} > h=${content:20:9} > echo ${content:30} | convert -size "$w"x"$h" -depth 8 rgba:- png:-
Isn't ${var:1:2} a bashism? I prefer cut :)