I forgot the EOF tokens, sorry for the noise. I shouldn't do this while tired, or maybe at all.
% for(n in _get*){echo 'cat >' $n '<<EOF'; cat $n; echo EOF; echo} cat > _get_1_size <<EOF #!/data/plan9/plan9port/bin/rc ifs=' ' name = $1^/ dir = $2^/ # size dir; e.g. '12' or '12a' mkdir -p $dir fontsrv -p $name^$dir^font > $dir^font if(! ~ $status '') exit fontsrv -p $name^$dir^font | ssam '1d ,x=.* =d ,s=.+=& > '^$dir^'&=g ,x=^=i=fontsrv -p '''^$name^$dir^'''=' | rc EOF cat > _get_all_sizes <<EOF #!/data/plan9/plan9port/bin/rc ifs=' ' name = $1 sizedirs = `{fontsrv -p $name} if(! ~ $status '') exit for(dir in $sizedirs) { echo $dir >[1=2] mkdir -p $dir fontsrv -p $name^$dir^font > $dir^font fontsrv -p $name^$dir^font | ssam '1d ,x=.* =d ,s=.+=& > '^$dir^'&=g ,x=^=i=fontsrv -p '''^$name^$dir^'''=' | rc } EOF cat > _get_all_sizes-noaa <<EOF #!/data/plan9/plan9port/bin/rc # workaround for segfaults & stalls with some font/size combinations when anti-aliased. # uh, it's not just aa, but it's more likely with aa. ifs=' ' name = $1 sizedirs = `{fontsrv -p $name} if(! ~ $status '') exit for(dir in $sizedirs) { if(! ~ $dir *[0-9]a/) { echo $dir >[1=2] mkdir -p $dir fontsrv -p $name^$dir^font > $dir^font fontsrv -p $name^$dir^font | ssam '1d ,x=.* =d ,s=.+=& > '^$dir^'&=g ,x=^=i=fontsrv -p '''^$name^$dir^'''=' | rc } } EOF cat > _get_all_sizes-prefix-version <<EOF #!/data/plan9/plan9port/bin/rc ifs=' ' name = $1 sizedirs = `{fontsrv -p $name} if(! ~ $status '') exit for(dir in $sizedirs) { prefix = `{echo $dir | sed 's=/=='} fontsrv -p $name^$dir^font | ssam ',x=[^ ]+$=i='^$prefix^'-' > $prefix^.font fontsrv -p $name^$dir^font | ssam '1d ,x=.* =d ,s=.*=& > '^$prefix^'-&=g ,x=^=i=fontsrv -p '''^$name^$dir^'''= ' #| rc } EOF ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Td0ab6c3112c95493-M4b945fa58f69efff23098167 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription