Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: esh



On Thu, Aug 31, 2000 at 05:02:06PM +0900, Frank BENNETT wrote:
> Does anyone know of a graceful way to persuade /usr/bin/esh to recognize the
> hash-bang hack?  Everything that I have tried ends up recursively loading
> the script ...
> 
> I can run scripts from that other shell with:
> 
>   "cat <scriptname> | /usr/bin/esh"
> 
> but with this, every esh script looks the same in the process table.

esh? Never heard of it. Let's see...oh, it's a Unix shell that talks scheme.
Ewww. Gross. I didn't need to see that.

Anyway, there is no *graceful* way to do it, as far as I can tell. However,
if you dispense with the "graceful" part, though, you can put the following
hack in your ~/.eshrc:

(if ~(not-null? (stack)) 
    ~(begin 
            (script (pop))
            (exit)
      )      
     ())

which will make esh evaluate the first argument as a script filename and
exit on completion if there are any arguments on the command line. Then
scripts like this will work:

#! /usr/bin/esh 

(run-simple ~(ls))
(cd)
(run-simple ~(sleep 10))
(run-simple ~(ls))

while typing "esh" on the command line will result in the ordinary
interactive shell.

-- 
Shimpei Yamashita                   <http://www2.gol.com/users/shimpei/>
"Outlook not so great"  -- Microsoft Access 2000 "Magic 8-Ball" Easter Egg


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links