[plt-scheme] mzscheme/shell script fails when "!" is near end of command-line argument

From: Terrence Brannon (metaperl at urth.org)
Date: Tue Jul 13 03:37:51 EDT 2004

I have a bash script which invokes MzScheme. However, when I supply an 
argument with "!" at or near the end of the command line, I get an error 
msg. Interestingly enough, the error only occurs when I use an rxvt 
terminal window. Running the same script within an xemacs shell works 
fine. So it looks like I have a technical issue with my rxvt bash shell 
and not MzScheme, but I am not entirely sure. I'd appreciate any help 
with this issue.

Here is my script:
#!/bin/bash -x

MZS=~/install/PLT/MzScheme
SCMLIB=~/mydocs/Scheme/lib

cd $SCMLIB

$MZS --mzlib cmdline.ss --load start.scm --load lamlx/local.scm -e 
"(srfi-news \"$1\")"


And here is a sample session with successful and failed usages:
$ ./srfi-news "--- Boring news ---"
+ MZS=/home/metaperl/install/PLT/MzScheme
+ SCMLIB=/home/metaperl/mydocs/Scheme/lib
+ cd /home/metaperl/mydocs/Scheme/lib
+ /home/metaperl/install/PLT/MzScheme --mzlib cmdline.ss --load 
start.scm --load lamlx/local.scm -e '(srfi-news "--- Boring news ---")'
Welcome to MzScheme version 207, Copyright (c) 2004 PLT Scheme, Inc.

Welcome to LAML Version 23.00 (December 12, 2003, full).
(C) Kurt Normark, Aalborg University, Denmark.
Using LAML in directory: c:/Programs/laml/
local.scm loaded
/msg sarahbot: SRFI-news is [July 13, 2004, 03:31:22] --- Boring news 
---. Relevant sarahbot queries: elucidation-what? elucidation-why? 
elucidation-SRFI-1? reduce-tut? SRFI-1? LAML? TSPL? SRFI-news?
 > (exit)
        ~/mydocs/Scheme/bin $ ./srfi-news "--- boring news ---!"
bash: !": event not found
        ~/mydocs/Scheme/bin $

-- 
  (let recur ((lis x) (k k)) 
    (if (zero? k) (values '() lis) 
	(receive (prefix suffix) (recur (cdr lis) (- k 1)) 
	  (values (cons (car lis) prefix) suffix))))) 



Posted on the users mailing list.