Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.029 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'parser': 0.07; 'subject:script': 0.09; 'subject:How': 0.10; 'cc:addr:python- list': 0.11; 'command,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'happily': 0.16; 'subject:run': 0.16; 'two.': 0.16; 'wrote:': 0.18; 'first.': 0.19; 'cc:addr:python.org': 0.22; 'creating': 0.23; 'interpret': 0.24; 'cc:2**0': 0.24; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'file': 0.32; 'option': 0.32; 'beginning': 0.33; 'fri,': 0.33; 'subject:from': 0.34; "can't": 0.35; 'connection': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'being': 0.38; 'pm,': 0.38; 'rather': 0.38; 'commands': 0.60; 'name': 0.63; 'provide': 0.64; '30,': 0.65; 'between': 0.67; 'connection.': 0.74; 'technically': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=SMzr0Jf0SL5PuFLDoOLvdgMv4aE2s9kdBrSTCNXRmd0=; b=zBhqO/kEJdN1Hv3lpqyip6LohEU3xrdNujK3IddKV7BQwCjQAzVO+75OYnqaR+BB2t LZ6B1tsl7pA09Hs3ucaNN8fRa6FDFQnIxADmuhe73PF9GsY+Fz7M9txQpLFwGg43lpHG Pq2WdADU9q2cuphD5koFR3s2wp2xUuGe6LXaix986zh08XKREpGvqDoA6N8hy9armryj Wr4rp8ZUoovVTvGoP911FSsJeERyphAHRu42NcbEizGyatNJAURCgvBuEH9GcWdsiA6u O/jjdbQgHD+/Qg/rujr4IdPw7MDK1QiPuekMxnUjbS7WUQlc5F7RUADYoe4/HrcGuOC7 hBtA== MIME-Version: 1.0 X-Received: by 10.180.87.165 with SMTP id az5mr4017136wib.10.1401434340347; Fri, 30 May 2014 00:19:00 -0700 (PDT) In-Reply-To: <5388233e$0$29978$c3e8da3$5496439d@news.astraweb.com> References: <6e96c4c4-17db-464b-b291-816c534b70c4@googlegroups.com> <5386a7e2$0$11109$c3e8da3@news.astraweb.com> <5387d1c4$0$29978$c3e8da3$5496439d@news.astraweb.com> <5387e3b1$0$29978$c3e8da3$5496439d@news.astraweb.com> <5388233e$0$29978$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 30 May 2014 17:19:00 +1000 Subject: Re: How to run script from interpreter? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1401434346 news.xs4all.nl 2855 [2001:888:2000:d::a6]:53698 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72283 On Fri, May 30, 2014 at 4:20 PM, Steven D'Aprano wrote: >> It's on par with creating a file with a name beginning with a >> hyphen, and then fiddling around with various commands as you try to >> manipulate it (tip: "rm ./-r" works); programs will happily interpret >> "-r" as an option rather than a file name, without being concerned that >> it's technically legal. > > I don't see any connection between the two. -r is a valid file name, just as . is a valid line of input. But with the rm command, you can't provide it with -r as a file name - you have to use ./-r or somesuch, because the parser gets to it first. That's the connection. ChrisA