Can a shell be an "interpreter"?

From: trifon (ivaylo_iliev_at_hotmail.com)
Date: 11/17/03


Date: 16 Nov 2003 21:59:03 -0800

Sorry if this is trivial, couldn't find anything related.

If I have a script named bctest1:

#! /usr/bin/bc -q
2+2
quit
### bctest1 end ###

and run it, the output is:
$ ./bctest1
4

Instead of
#! /usr/bin/bc
I can have
#! /bin/bash,
#! /bin/octave, etc. whatever "interpreter" specified on the first
line. Is it possible the so called interpreter to be another script?
When I run bctest2 which is:

#! ./shellbc -q
2+2
quit
### bctest2 end ###

where shellbc is just:

### shellbc begin ###
/usr/bin/bc $*
### shellbc end ###

I get:
$ ./bctest2
./bctest2: line 2: 2+2: command not found
./bctest2: line 3: quit: command not found

although otherwise ./shellbc will do everything which /usr/bin/bc
would. There is no problem with the permissions, spelling, etc. I get
the same from all "interpreters" I've tryed, wrap them in another
script and can't execute your file.

Thanks for your help...



Relevant Pages

  • can a shell script be an "interpreter"
    ... If I have a script named bctest1: ... Is it possible the so called interpreter to be another script? ... where shellbc is just: ...
    (comp.unix.shell)
  • Re: Cant capture PID with script in cron
    ... Glad to see you have quit top posting and started responding after the ... That will make the script a little more portable to other systems ... o cron/at batch jobs are not hooked to a tty. ... # The applescript performs a function in the Mac OS scripting language ...
    (comp.unix.questions)
  • Re: going to try zyban again
    ... Let us know if you got the script, ... I quit on zyban when i was 21 when in college. ... i've only been smoking for less then a month. ...
    (alt.support.stop-smoking)
  • Re: keeping mail identities on Flash Drive
    ... I started a separate thread to deal with the issue ... a site wiht a ready to go script to use. ... you quit out of all of the other Office applications, ... Mickey Stevens ...
    (microsoft.public.mac.office.entourage)
  • Re: Script for daily quit not working ... thoughts?
    ... Barry Wainwright wrote: ... > script, not an application. ... Script for daily quit not working ... ... >> Entourage, but it started NOT working a few versions ago. ...
    (microsoft.public.mac.office.entourage)