[vox-tech] help with script

Peter Jay Salzman vox-tech@lists.lugod.org
Thu, 3 Oct 2002 14:24:04 -0700


excellent, mike!  thanks.

question -- is it possible to automatically apply a perl script to the
body within mutt?

or perhaps using procmail:

:0 H:
* ^Subject:.*[Pp]hys.*105[aA][lL].*
| mikes_script.pl | 105

i don't know if you can have two pipes on a procmail action line.  guess
i'll have to fiddle around to find the most convenient way of doing
this.

thanks for the tip!
pete

begin msimons@moria.simons-clan.com <msimons@moria.simons-clan.com> 
> On Thu, Oct 03, 2002 at 12:16:19AM -0700, Peter Jay Salzman wrote:
> > i'm allowing my students to turn in their assignments electronically
> > this quarter.  they're writing C or fortran programs.  i'm requiring
> > them to turn in:
> > 
> > 1. the program
> > 2. a file showing the compile process and the program output.
> 
>   My recommendation is require that the students turn in a Makefile 
> with well defined targets... like:
> ===
> make clean   - this must remove all temporary files created using 
>                any other make targets
> make all     - this must compile your program from a clean state
> make test    - this must run your program with sample input files
>                "FOO, BAR, BAZ"
> ===
> 
>   Have them turn in a raw "script" output showing them run only the 
> following command: "make clean; make all; make test"... so that
> you can see what they "see".
> 
> ... if these students don't know make, then maybe you can supply them
> with a makefile and tell them what sections to change?
> 
> 
> > for #2, i'm having them use "script".
> 
>   If the makefile isn't okay.
> 
>   It will likely take you much less time to strip out the terminal
> crap generated on your end, than it will to write a good shell.
> 
> 
>   The perl crud below is something I put together quickly for my own 
> purposes... which mostly works the 'cat -A' gets all extra special
> characters on the screen.
> 
> perl -ne 'while (s/[^\b][\b] [\b]//g) {}; # remove simple backspaces
>           s/\e\[[\d;?]*[a-zA-Z\@]//g;     # kill most vt100 escapes
>           s/\e\]0;[^\a]+\a//;             # kill vt100 title bar text
>           s/[\b]//g;                      # kill other backspaces
>           s/\r\n/\n/;                     # strip last carriage return
>           s/^.*\r//g;                     # nuke text before remaining cr
>           s/\a//g;                        # nuke bells
>           print' 
> test | cat -A | less
> 
> ===
> ps:
>   The only lines that don't really work well are the "backspace"
> handling ones... because on a '^H' moves the cursor left display
> without removing the character... so when someone arrows to the
> left a bunch of ^H are logged.  This doesn't track where someone
> moves.
> ===
> 
> 
> > i can write a script that presents a shell like interface which short
> > circuits this stuff saves their program output to a file, but if
> > something is already written, i'd rather go that route.
> 
>   You are basically thinking about writing a shell...
> 
>   Unless you have spare time, I would just recommend you continue to 
> have them use script... since you won't need to spend time developing
> something and handling random support issues (maybe like "why doesn't vi
> work inside this thing", "why doesn't ^R do a reverse search of my history", 
> "why doesn't ESC0/^A go to the beginning of line", etc).
> 
>   TTFN,
>     Mike
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech

-- 
Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D