From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26574 invoked by alias); 6 Jan 2012 18:45:46 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16707 Received: (qmail 26245 invoked from network); 6 Jan 2012 18:45:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=mesmtp; bh= oE1JxDYPqgT/8YwQbqjnsiSGY08=; b=nOAfGJHH1DaTxEN0ZawFdUc0WqMFQVLe mx/z52YdhFbwWAr7YsVjsRxyBl6wAxHl4dhm3erFFoGLk6pbE6Yvra1rTqq/WWXC TCcvKG+D7uJk86UkJ17aJew/5DPf4k0HjwSmqGKSqDOtsClt+2n4Qk9olMKMzzgb ORSHWqIEp3g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=smtpout; bh=oE1JxDYPqgT/8YwQbqjnsiSGY08=; b=H6XsxGFCDXnv3/YT2/u3qQF9aIuk qy8DgDintdh87tZ2tDnDS0D4tjd3NOCuNHpwYhBlWbGBscg2+VNUIeNC92fAiWXe NZWUQQ+Zg8WFbBEOm1b2otrUCMU0ss+ZNUj1H3NY0oe5GDBQoPQpIz/PKW5YmfMd cwj5V4SjIBaGQr0= X-Sasl-enc: 1oY3kSchkjOxcYdSUa5vu5R2QaoNmFM797lqAuIsnOydvJsw58or7Srm9oUt2g 1325875537 Date: Fri, 6 Jan 2012 20:43:51 +0200 From: Daniel Shahaf To: Isaac Huang Cc: zsh-users@zsh.org Subject: Re: redirecting stdout of no/empty command Message-ID: <20120106184351.GA26599@daniel3.local> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Isaac Huang wrote on Fri, Jan 06, 2012 at 11:34:26 -0700: > Hi list, > > I noticed a zsh behaviour today. If I tried to run '>/dev/null' (i.e. > stdout redirection of no command at all) on an interactive zsh, the > zsh would actually run a 'cat', and it wouldn't exit until a ^D or ^C. > > The same thing on bash seemed to be a no-op. Actually it truncates the file. $ echo foo>1 $ >1 $ cat 1 $ > I wonder why zsh would > run 'cat' when it was given no command to run at all. > As a shorthand. See also NULLCMD and READNULLCMD in zshall(1). > Please CC me as I'm not on the list. Thanks. > > - Isaac