Thread Shebang für Windows und Linux/Unix (5 answers)
Opened by Hagen at 2008-05-02 00:39

FIFO
 2008-05-02 00:58
#109078 #109078
User since
2005-06-01
469 Artikel
BenutzerIn

user image
Am einfachsten ist m.E. tatsächlich, dem Indianer das Verwenden der Dateizuordnung aus der Registry vorzuschlagen, hier beschrieben in /xampp/apache/conf/httpd.conf:

# However, Apache on Windows allows either the Unix behavior above, or can
# use the Registry to match files by extention. The command to execute
# a file of this type is retrieved from the registry by the same method as
# the Windows Explorer would use to handle double-clicking on a file.
# These script actions can be configured from the Windows Explorer View menu,
# 'Folder Options', and reviewing the 'File Types' tab. Clicking the Edit
# button allows you to modify the Actions, of which Apache 1.3 attempts to
# perform the 'Open' Action, and failing that it will try the shebang line.
# This behavior is subject to change in Apache release 2.0.
#
# Each mechanism has it's own specific security weaknesses, from the means
# to run a program you didn't intend the website owner to invoke, and the
# best method is a matter of great debate.
#
# To enable the this Windows specific behavior (and therefore -disable- the
# equivilant Unix behavior), uncomment the following directive:
#
#ScriptInterpreterSource registry
#
# The directive above can be placed in individual <Directory> blocks or the
# .htaccess file, with either the 'registry' (Windows behavior) or 'script'
# (Unix behavior) option, and will override this server default option.
#

Alternativ kann man eine /usr/bin-Struktur incl. Perl im Windows-Verzeichnis/-laufwerk "nachbauen", so dass der Shebang immer funktioniert.
[edit] Vielleicht etwas missverständlich ausgedrückt: Das Verzeichnis \usr muss dann natürlich im root-Verzeichnis des Laufwerks liegen, auf dem auch XAMPP liegt, also z.B. H:\usr etc., das funktioniert auch auch einem Share (Netzlaufwerk)
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? -- Brian Kernighan: "The Elements of Programming Style"

View full thread Shebang für Windows und Linux/Unix