zsh-users
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: chandan <chandanrmail@gmail.com>
Cc: zsh-users@zsh.org
Subject: Re: zsh blocks at file truncation
Date: Sat, 21 Sep 2013 00:53:11 -0700	[thread overview]
Message-ID: <20130921075311.GA60191@redoubt.spodhuis.org> (raw)
In-Reply-To: <12896374.TIKZVcXBhR@localhost.localdomain>

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.


  parent reply	other threads:[~2013-09-21  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-21  7:10 chandan
2013-09-21  7:46 ` Bart Schaefer
2013-09-21  7:53 ` Phil Pennock [this message]
2013-09-25  8:49 ` zzapper
2013-09-25  9:23 ` Marko Vihoma
2013-09-25 14:54   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130921075311.GA60191@redoubt.spodhuis.org \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --cc=chandanrmail@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).