<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Is that #! or #!!<br><br><div id="AppleMailSignature" dir="ltr"><span style="font-size: 13pt;">/————————————————————/</span><div><span style="font-size: 13pt;">For encrypted mail use <a href="mailto:jgpfersich@protonmail.com">jgpfersich@protonmail.com</a></span><div>Get a free account at <a href="http://ProtonMail.com">ProtonMail.com</a></div><div>Web: <a href="http://www.objectnets.net">www.objectnets.net</a> and <a href="http://www.objectnets.org">www.objectnets.org</a></div></div></div><div dir="ltr"><br>On May 5, 2019, at 19:55, <a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><span>David T. Lewis uploaded a new version of System to project The Trunk:</span><br><span><a href="http://source.squeak.org/trunk/System-dtl.1062.mcz">http://source.squeak.org/trunk/System-dtl.1062.mcz</a></span><br><span></span><br><span>==================== Summary ====================</span><br><span></span><br><span>Name: System-dtl.1062</span><br><span>Author: dtl</span><br><span>Time: 5 May 2019, 10:54:56.642077 pm</span><br><span>UUID: c527ef41-51fb-4e49-b00a-90a9a09a935d</span><br><span>Ancestors: System-cmm.1061</span><br><span></span><br><span>If CodeLoader is loading a script that begins with a Unix shebang line, then skip over line one of the script. This accomodates the case of an executable Unix shell script that starts a Squeak image, then feeds itself to Squeak as a start script. For example, an executable script file might contain this:</span><br><span></span><br><span>#!/usr/local/bin/squeak --</span><br><span>Transcript show: 'Hello, world'; cr.</span><br><span></span><br><span>=============== Diff against System-cmm.1061 ===============</span><br><span></span><br><span>Item was added:</span><br><span>+ ----- Method: CodeLoader>>allButShebangLine: (in category 'private') -----</span><br><span>+ allButShebangLine: contentsString</span><br><span>+ "If tontentsString begins with '#!!' then assume that it contains a Unix</span><br><span>+ shebang line should be skipped prior to evaluating the contents."</span><br><span>+ </span><br><span>+ (contentsString beginsWith: '#!!')</span><br><span>+ ifTrue: [contentsString lineIndicesDo: [:line :end :endOfLine |</span><br><span>+ ^ contentsString allButFirst: endOfLine ]]</span><br><span>+ ifFalse: [^ contentsString]</span><br><span>+ </span><br><span>+ " CodeLoader new allButShebangLine:</span><br><span>+ '#!!/usr/llocal/bin/squeak --</span><br><span>+ Transcript cr; show: ''Hello world!!''</span><br><span>+ ' "!</span><br><span></span><br><span>Item was changed:</span><br><span> ----- Method: CodeLoader>>installSourceFile: (in category 'installing') -----</span><br><span> installSourceFile: aStream</span><br><span> "Install the previously loaded source file"</span><br><span> | contents trusted |</span><br><span> aStream ifNil:[^self error:'No content to install'].</span><br><span> trusted := SecurityManager default positionToSecureContentsOf: aStream.</span><br><span> trusted ifFalse:[(SecurityManager default enterRestrictedMode) </span><br><span> ifFalse:[ aStream close.</span><br><span> ^ self error:'Insecure content encountered']].</span><br><span>+ contents := self allButShebangLine: aStream upToEnd unzipped asString.</span><br><span>- contents := aStream upToEnd unzipped asString.</span><br><span> (aStream respondsTo: #close) ifTrue:[aStream close].</span><br><span> ^contents readStream fileIn!</span><br><span></span><br><span></span><br></div></blockquote></body></html>