#!Shebang

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

#!Shebang

Otan
In Unix, we can make an executable script by putting shebang at the beginning of the script. something like:
#!/bin/sh
or
#!/usr/bin/python
or
#!/usr/bin/ruby

is it possible to achieve such functionality through BeanShell? How can I do that?

Thanks.


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

Re: #!Shebang

Otan
Maybe this might help the others.  For Windows batch file:
~~~~ Test.bat ~~~~~~~~~~~~~~~~~~~~~
rem;/*
    @echo off
    echo.
    java -cp bsh-2.0b4.jar bsh.Interpreter %0%
    goto :EOF
rem */
 
print("Hello World!");
frame(new Label("Hello World!"));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



I found this one in the BeanShell Manual. This is for Unix:
~~~~ Test.sh ~~~~~~~~~~~~~~~~~~~~~~
#!/bin/sh
//bin/true; exec java -cp bsh-2.0b4.jar bsh.Interpreter "$0" "$@"

print("\nHello World!\n");
frame(new Label("Hello World!"));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


(Don't forget to edit the classpath with the correct path to the bsh jar)



On 04/10/06, Otan <[hidden email]> wrote:
In Unix, we can make an executable script by putting shebang at the beginning of the script. something like:
#!/bin/sh
or
#!/usr/bin/python
or
#!/usr/bin/ruby

is it possible to achieve such functionality through BeanShell? How can I do that?

Thanks.



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