home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!icdoc!dds
- From: dds@doc.ic.ac.uk (Diomidis D Spinellis)
- Newsgroups: comp.lang.perl
- Subject: Re: #! Emulation in MSDOS
- Message-ID: <1992Aug13.132107.24139@doc.ic.ac.uk>
- Date: 13 Aug 92 13:21:07 GMT
- References: <1992Aug13.044323.1094@silogic.uucp>
- Sender: usenet@doc.ic.ac.uk
- Organization: Department of Computing, Imperial College, University of London, UK.
- Lines: 24
- Nntp-Posting-Host: swan.doc.ic.ac.uk
-
- 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"
-