use dd ifs=$n count=1 ... rather than less-portable head -c$n