l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2002 Oct 03 14:25

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)
Re: [vox-tech] help with script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] help with script

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
test | cat -A | less

  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

> 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).

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
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:
Sunset Systems
Who graciously hosts our website & mailing lists!