From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 19 Jan 2011 00:50:24 +0530 Message-ID: From: Arvindh Rajesh Tamilmani To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [9fans] assigning acme windows to columns programmatically Topicbox-Message-UUID: 9eedde1a-ead6-11e9-9d60-3106f5b1d025 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 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