the inferno sh script below shows a rather terrible way to
open a file in a given acme column.
arvindh
#!/dis/sh
load std expr string
usage := 'usage: bcol colnum file'
fn xcmd{
(cwin cmd) := $*
q0 := `{wc -c </mnt/acme/$cwin/tag}
q1 := ${expr $q0 ${len $"cmd} +}
echo -n $cmd > /mnt/acme/$cwin/tag
echo Mx$q0 $q1 > /mnt/acme/$cwin/event
}
if{! ~ $#* 2}{
echo $usage >[1=2]
raise fail:usage
}
(col file) := $*
(d0 d1) := /tmp/bcol ^ (0 1) ^ .${pid}
(cwin _) := `{cat /mnt/acme/new/ctl}
xcmd $cwin (Dump $d0)
{sed 4q $d0
echo f^${padr 11 $col}^' 0 0 0 0 '
echo ' 0 0 0 0 0 ' ^
$file ^
' Del Snarf | Look '
} > $d1
xcmd $cwin (Load $d1)
rm $d0 $d1
echo delete > /mnt/acme/$cwin/ctl