l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
December 2: Social gathering
Next Installfest:
TBD
Latest News:
Nov. 18: Club officer elections
Page last updated:
2002 Oct 04 11:36

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] Re: help with script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] Re: help with script



> ---ORIGINAL MESSAGE---
> Date: Thu, 3 Oct 2002 00:16:19 -0700
> To: vox-tech@lists.lugod.org
> From: Peter Jay Salzman <p@dirac.org>
> Subject: [vox-tech] help with script
> Reply-To: vox-tech@lists.lugod.org
> 
> hi lugod,
> 
> 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.
> 
> for #2, i'm having them use "script".
> 
> however, script shows annoying ^M's plus any kind of backspacing and
> term codes:
> 
>    Script started on Wed Oct  2 17:00:24 2002
>    ^[]0;dhevan@jensen:~^G[dhevan@jensen dhevan]$ cc program1.c^M
>    ^[]0;dhevan@jensen:~^G[dhevan@jensen dhevan]$ exit^M
     ^^^^^^^^^^^^^^^^^^^^^^
     Judging from this sequence, it looks like the work was done in an
     xterm.

>    exit^M
> 
> some of these people hardly know how to log into a unix system, let
> alone use sed or even vi's ex commands.  i'm astounded that most of them
> use vi at all.
> 
> 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.
> 
> any suggestions?   what does the CS department do for electronically
> submitted document?

In all of my ECS classes thus far (ECS40 and ECS110, both with Sean
Davis), the students submitted their program source code (and makefile)
electronically using `handin' (which enough other people have described
here that I don't need to), and the the professors would build our
programs themselves from our sources and run them using their own custom
shell scripts.

Students are expected to match their professors' program's output to the
point where `diff' would return no differences. The professors' shell
scripts grep through our output, looking for the essential pieces of the
correct output (however we are not told in advance what patterns they
are looking for, what input they will throw at our programs, nor what
other data they look for to find the output).

In this way, professors save time, and they know that the output is from
our binaries (and not from the sample binaries that they gave us, nor the
result of our own painstaking typing using $EDITOR).



However, there is the interesting problem of what to do with the control
codes that `script' leaves in its output. There's a good answer to this:
a) don't try to print the document on a printer.
b) don't try to run the document through less (at least not without
reading every word of the manpage and trying to finding the appropriate
combination of switches, something I don't have time to do)

Instead of either of these two strategies, open an xterm with a
sufficiently large scrollback buffer, then cat the whole file into the
xterm. Examine it in the xterm.

If anyone knows of a program that can actually parse these annoyances out
of the script output, I think that's what we're really looking for here.

Remember script is supposed to be able to do the following:

xterm1:
$mkfifo foo
$script -f foo

xterm2:
$cat foo

and as you work in xterm1, the exact same thing appears instantaneously
in xterm2. (this cool trick is documented in `man script' as the
explanation to the -f option.)

--Ken
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.