From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Mon, 28 Nov 2005 15:49:25 -0500 From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] find acme 'window' name from which program B2-ed? In-Reply-To: <200510122248.j9CMmb720817@zamenhof.cs.utwente.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200510112012.j9BKCL815892@zamenhof.cs.utwente.nl> <200510122248.j9CMmb720817@zamenhof.cs.utwente.nl> Topicbox-Message-UUID: b3834dfc-ead0-11e9-9d60-3106f5b1d025 I used this today for a talk about shell scripts and scripting in general. It provided a nice illustration midway through the talk. These are the final versions I used (on Unix). Three scripts: Slide, Slide-, and Slide+. lucidasans/unicode.13.font was good, though I might have preferred something ever so slightly larger. Thanks! Russ # To unbundle, run this file echo Slide sed 's/.//' >Slide <<'//GO.SYSIN DD Slide' -#!/usr/local/plan9/bin/rc - -echo name `{pwd}^/$1 | 9p write acme/$winid/ctl -echo clean | 9p write acme/$winid/ctl -echo get | 9p write acme/$winid/ctl - //GO.SYSIN DD Slide echo Slide+ sed 's/.//' >Slide+ <<'//GO.SYSIN DD Slide+' -#!/usr/local/plan9/bin/rc - -name=3D$% -current=3D`{basename $name} -currentx=3D`{9 grep -n '^'$current'([ =09]|$)' index | sed 's/:.*//'} - -pagex=3D`{echo $currentx + 1 | hoc} -page=3D`{sed -n $pagex^p index | awk '{print $1}'} -if(~ $#page 0){ -=09echo no such page -=09exit 0 -} - -Slide $page //GO.SYSIN DD Slide+ echo Slide- sed 's/.//' >Slide- <<'//GO.SYSIN DD Slide-' -#!/usr/local/plan9/bin/rc - -name=3D$% -current=3D`{basename $name} -currentx=3D`{9 grep -n '^'$current'([ =09]|$)' index | sed 's/:.*//'} - -pagex=3D`{echo $currentx - 1 | hoc} -if(~ $pagex 0){ -=09echo no such page -=09exit 0 -} -page=3D`{sed -n $pagex^p index | awk '{print $1}'} -if(~ $#page 0){ -=09echo no such page -=09exit 0 -} - -Slide $page //GO.SYSIN DD Slide-