Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'output': 0.05; 'root': 0.05; 'differently': 0.07; 'modify': 0.07; 'subject:Error': 0.07; 'append': 0.09; 'arguments': 0.09; 'arguments,': 0.09; 'bash': 0.09; 'skip:/ 10': 0.09; 'so?': 0.09; 'argument.': 0.16; 'behave': 0.16; 'command.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'script,': 0.16; 'stdout': 0.16; 'superfluous': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'seems': 0.21; '>>>': 0.22; 'aug': 0.22; 'script.': 0.24; 'equivalent': 0.26; 'read,': 0.26; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'pipe': 0.31; 'maybe': 0.34; 'subject:the': 0.34; 'could': 0.34; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'version': 0.36; '14,': 0.36; 'subject:?': 0.36; 'wrong': 0.37; 'others.': 0.38; 'to:addr:python-list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'either': 0.39; 'letters': 0.60; 'august': 0.61; 'full': 0.61; 'simply': 0.61; "you're": 0.61; 'direct': 0.67; 'batchelder': 0.84; 'quickest': 0.84; '2013': 0.98 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:to :content-type; bh=INmHgscl6UaHJbS6CJptc1Tax2hK4/K5k7NGu59XH+8=; b=wDmLQAbZ+7ZkQAWKwxeRMDeNnibS06tZuieTF8m/VbK57T3cKvDo0UNwDQp2okiEOK DVBhqaAmg/BRwp0N+9wl+5EimKdZIJKwMLYHBf5meKX2X8ZE7BPOCJLvYonk4U4Npsf6 kT3wdMboW1DHojOIW6wOBNCYw/tWor6EN/GJn8ErkvpEa3zW3QPnPD2GUgELuS9BJ9Qg twi3FVYcPtrIB8EmtNnweYVKtp6pHNVG992/135wqnuPIoe8wl4AAi662lemsy0Nampi K3E87nnfUTawtv7TUueZf/3FvOYTK01iC0X/EbVxUtjuKCfLC2onmE3HeDoPxp/benw8 8dmA== MIME-Version: 1.0 X-Received: by 10.52.233.33 with SMTP id tt1mr8042365vdc.2.1376482058515; Wed, 14 Aug 2013 05:07:38 -0700 (PDT) In-Reply-To: References: Date: Wed, 14 Aug 2013 13:07:38 +0100 Subject: Re: Am I not seeing the Error? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376482061 news.xs4all.nl 15919 [2001:888:2000:d::a6]:59869 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52510 On Wed, Aug 14, 2013 at 7:59 AM, Joshua Landau wrote: > On 14 August 2013 02:20, Gregory Ewing wrote: >> Ned Batchelder wrote: >>> >>> Everyone: this program seems to be a direct and misguided transliteration >>> from a bash script. >> >> Not a particularly well-written bash script, either -- >> it's full of superfluous uses of 'cat'. > > What's wrong with cat? Sure it's superfluous but what makes it *bad*? > Personally I often prefer the pipe "cat x | y" form to "x < y"... or > "< y x". What's the use of it, in that situation? Why not simply use redirection? (Though you have the letters backward; "cat y | x" would be the equivalent of your others. Typo, I assume.) You're forking a process that achieves nothing, if your cat has just one argument. Of course, there ARE many good uses for cat. If you give it multiple arguments, or if you have arguments that modify the output on the way through (eg "cat -n"), then it's not the same as redirection. And some programs behave differently if stdout is a tty, so the quickest way to get the porcelain version of something is to append "|cat" to the command. Or maybe you need to retrieve something that only root can read, so you use "sudo cat /x/y/z|somescript". But if you could spell it "x < y", then why not do so? ChrisA