From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24104>; Thu, 20 Apr 1995 12:21:17 -0400 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA03680; Thu, 20 Apr 95 17:20:54 BST Received: from spirit.cegelecproj.co.uk (spirit.limbo.cegelecproj.co.uk) by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA02918; Thu, 20 Apr 1995 17:20:51 +0000 Received: by spirit.cegelecproj.co.uk (5.0/SMI-SVR4) id AA02372; Thu, 20 Apr 1995 17:20:46 +0000 Date: Thu, 20 Apr 1995 13:20:46 -0400 From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane) Message-Id: <9504201620.AA02372@spirit.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: sam-fans@hawkwind.utcs.toronto.edu Subject: sam's pipe X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 Does anyone actually use sam's input pipe, apart from with the B command? Generally, I've hardly used it at all, but I was reading Rob's Acme paper the other day, and it mentioned sam interacting with the compiler and debugger, and I thought, why not? Took about five minutes to write a script for handling compiler errors: the script reads error messages to its stdin, and tells sam to go to the appropriate file/line. The input "make" is an exception; it does just that. feels quite nice. And no, I haven't done anything about debugger interaction.:-) So, I was just wondering if anyone else has written any other useful applications with sam's pipe.... steve #!/bin/rc # Script for going to lines with errors in. Usage: run with # no arguments, and the error lines to stdin. Sends # commands to sam's pipe. # First bit comes straight from 'B': if (~ $#USER 0) USER=$LOGNAME pipe=/tmp/.sam.$USER if (! ~ $#DISPLAY 0) pipe=$pipe.$DISPLAY if (! test -r $pipe) { echo `{basename $0}^': No pipe "'$pipe'" to sam.' >[1=2] exit 1 } while (cmd = `line) { if (~ $cmd '') { exit } if (~ $cmd (make exit)) { $cmd } else { cmd = `{echo $cmd | sed -ne 's/^"\([^"]*\)", line \([0-9]*\).*/f=''\1''; line=\2/p'} eval $cmd echo B $f >> $pipe echo $line >> $pipe } }