Re: executable postscript programs?



On 2010-12-07, Ilya Zakharevich wrote:
On 2010-12-07, luser- -droog <mijoryx@xxxxxxxxx> wrote:
Is there a way to trick bash into accepting % instead of #
on the bang line?
I'd like to put
%!/usr/bin/gs
at the front of my postscript program to run the script as a command.

bash does not (AFAIK) read this line. You need to trick the kernel.
(Which may be not a big deal if you are on cygwin. ;-)

man bash:

If the program is a file beginning with #!, the remainder of
the first line specifies an interpreter for the program. The
shell executes the specified interpreter on operating systems
that do not handle this executable format themselves.

--
Chris F.A. Johnson, author <http://shell.cfajohnson.com/>
===================================================================
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)

.



Relevant Pages

  • Shell Games
    ... We had no such mandate for the new web server. ... or Novell's login scripts to get network scripting done. ... I never had to chang a shell, ... CSHELL and BASH all on the same machine? ...
    (freebsd-newbies)
  • Re: [ Attn: Randy ] Ad-hoc Parsing?
    ... I think you're getting confused by the fact that the Bourne shell (sh, ... If your scripting language is incapable of dropping arbitrary data ... that this also is possible with bash scripts. ... That includes executables of all types. ...
    (alt.lang.asm)
  • Re: Shell Games
    ... We had no such mandate for the new web server. ... There isn't a 'best' shell - this is the stuff of flamewars. ... My personal preference is Bash. ... > or Novell's login scripts to get network scripting done. ...
    (freebsd-newbies)
  • C/C++ interpreter Ch 6.0 available
    ... 2D/3D plotting, numerical computing, shell programming and embedded ... Embeddable scripting ...
    (comp.compilers)
  • [ann] C/C++ interpreter Ch 6.0 released
    ... 2D/3D plotting, numerical computing, shell programming and embedded ... Embeddable scripting ...
    (comp.programming)