Re: #!Shebang

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: #!Shebang

backspaces
On Mac OS X, I just use the env version, which I think is also  
standard on all *nix systems now adays.

#!/usr/bin/env bsh
...

.. making sure the file is executable.  Then simply launching the  
file from the terminal works just fine.  The "bsh" script is the usual:
   #!/bin/sh
   export CLASSPATH=$CLASSPATH:/Users/owen/local/bsh/bsh-2.0b4.jar
   java bsh.Interpreter $@
.. which I keep on my PATH, so env finds it.

     -- Owen

Owen Densmore   http://backspaces.net



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

#!Shebang (improved)

Douglas D. Dickinson
A couple of minor fixes to the `bsh` script:
  - ""s to preserve any spaces in arguments or CLASSPATH
  - `exec` so that exit/return values are preserved (sent back
    to the caller)
  - separate `VAR=value` from `export VAR` for maximum backward
    compatibility with older versions of `sh`

So, my `/tools/bin/bsh` script looks like:
    #!/bin/sh
    CLASSPATH="$CLASSPATH:/tools/java/lib/bsh/bsh-2.0b4.jar"
    export CLASSPATH
    exec java bsh.Interpreter "$@"

All the best,
./ddd

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Owen
Densmore
Sent: Thursday, November 23, 2006 3:25 PM
To: [hidden email]
Subject: Re: [Beanshell-users] #!Shebang

On Mac OS X, I just use the env version, which I think is also standard on
all *nix systems now adays.

#!/usr/bin/env bsh
...

.. making sure the file is executable.  Then simply launching the file from
the terminal works just fine.  The "bsh" script is the usual:
   #!/bin/sh
   export CLASSPATH=$CLASSPATH:/Users/owen/local/bsh/bsh-2.0b4.jar
   java bsh.Interpreter $@
.. which I keep on my PATH, so env finds it.

     -- Owen

Owen Densmore   http://backspaces.net



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's
Techsay panel and you'll get the chance to share your opinions on IT &
business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users