Newsgroups: | comp.lang.perl |
Path: | icdoc!dds |
From: | dds@doc.ic.ac.uk (Diomidis D Spinellis) |
Subject: | Re: #! Emulation in MSDOS |
Message-ID: | <1992Aug13.132107.24139@doc.ic.ac.uk> |
Sender: | usenet@doc.ic.ac.uk |
Nntp-Posting-Host: | swan.doc.ic.ac.uk |
Organization: | Department of Computing, Imperial College, University of London, UK. |
References: | <1992Aug13.044323.1094@silogic.uucp> |
Date: | Thu, 13 Aug 1992 13:21:07 GMT |
Lines: | 24 |
Content-Length: | 1190 |
In article <1992Aug13.044323.1094@silogic.uucp> markd@silogic.uucp (Mark C. DiVecchio (K3FWT)) writes:
>In a recent posting, I saw a reference to #! emulation in MSDOS. The
>posting showed a code fragment which was to be place at the front of the
>file:
>@REM=(qq!
>@echo off
>perl %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
>@goto end :) if 0;
>After trying this, it became obvious that a line or two is required at
>the end of the file after the Perl code. I'm not versed enough in Perl
>to figure out the lines at the end.
You do not need any code at the end of the script, if you modify the @goto end
command to read just @end. Then add an empty file in your path named end.bat.
When MS-DOS invokes a batch file from within another batch file, the code
behaves like a jump, not a call i.e. after the second batch file terminates
control will _not_ return to the original, invoking, batch file. Thus then
empty end.bat batch file effectively adds a command to terminate batch files
to your system.
Diomidis
--
Diomidis Spinellis Internet: <dds@doc.ic.ac.uk> UUCP: ...!uknet!icdoc!dds
Department of Computing, Imperial College, London SW7 #include "/dev/tty"
Newsgroup comp.lang.perl contents
Newsgroup list
Diomidis Spinellis home page
Unless otherwise expressly stated, all original material on this page created by Diomidis Spinellis is licensed under a Creative Commons Attribution-Share Alike 3.0 Greece License.