Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'arguments': 0.07; 'true)': 0.07; 'python': 0.09; '(without': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '2.7': 0.13; 'extension': 0.13; 'file,': 0.15; '"hello': 0.16; '(note': 0.16; 'file1': 0.16; 'non- existing': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'shell': 0.18; 'code,': 0.18; 'example': 0.23; 'references': 0.23; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.28; 'writes:': 0.29; 'code': 0.31; 'ubuntu': 0.33; 'to:addr:python-list': 0.33; 'server': 0.35; 'received:org': 0.36; 'really': 0.36; 'but': 0.36; 'charset:us- ascii': 0.36; 'subject:: ': 0.38; 'speak': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'received:217': 0.68 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dieter Maurer Subject: Re: os.system and subprocess odd behavior Date: Sat, 15 Dec 2012 08:12:15 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gmane-NNTP-Posting-Host: pd9e088cd.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) Cancel-Lock: sha1:HUAHBBlj3VcApiuhzAeQz9FX8l0= 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1355555550 news.xs4all.nl 6971 [2001:888:2000:d::a6]:36925 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34884 py_genetic writes: > Example of the issue for arguments sake: > > Platform Ubuntu server 12.04LTS, python 2.7 > > Say file1.txt has "hello world" in it. ^^^^^^^^^ Here, you speak of "file1.txt" (note the extension ".txt") > subprocess.Popen("cat < file1 > file2", shell = True) > subprocess.call("cat < file1 > file2", shell = True) > os.system("cat < file1 > file2") But in your code, you use "file1" (without extension). If your code really references a non-existing file, you may well get what you are observing.