From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9219 invoked by alias); 21 Sep 2013 08:11:33 -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: 17988 Received: (qmail 245 invoked from network); 21 Sep 2013 08:11:20 -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=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at spodhuis.org designates 94.142.241.89 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=wjDdcMziz6HHsLmmxoLRytzUj+1l15nXDQi257w36Dc=; b=VPuOR+VDXRaF2FSmI6FKyjCxxsjp7nSKvY01aopkOW/781iWTgYEnFKu5/bFUUrno3i3ZgGQps/1N3yFNlj87PZmHlhOt/IIQ8nxvK0DqlJfigeGZS+doWDNCfo8/cPpv8MjLen1SWDYRiaSgA0iPWC4/Q+JE2CJ0xk0dwnNGZc=; Date: Sat, 21 Sep 2013 00:53:11 -0700 From: Phil Pennock To: chandan Cc: zsh-users@zsh.org Subject: Re: zsh blocks at file truncation Message-ID: <20130921075311.GA60191@redoubt.spodhuis.org> Mail-Followup-To: chandan , zsh-users@zsh.org References: <12896374.TIKZVcXBhR@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <12896374.TIKZVcXBhR@localhost.localdomain> OpenPGP: url=https://www.security.spodhuis.org/PGP/keys/0x3903637F.asc On 2013-09-21 at 12:40 +0530, chandan wrote: > On zsh, Why does the following block indefinitely? > > $ >file.txt That's a bare redirection, which means that you're invoking the empty command. In bash, that invokes ":", also known as "true". By _default_, in zsh, that's "cat" for writing and "more" for reading. See "REDIRECTIONS WITH NO COMMAND" in zshmisc(1) [or zshall(1)]. So you can either: setopt sh_nullcmd or set: NULLCMD=: READNULLCMD=: to get the behaviour which you're used to. For myself, I very often invoke: % >/dev/null to get a scratch space for fast notes which I don't want to live in editor swap files, or testing input echo'ing in a terminal without having a program other than the kernel and the terminal emulator try to interpret the keystrokes.