zsh-users
 help / color / mirror / code / Atom feed
From: Marko Vihoma <marko.vihoma@pp1.inet.fi>
To: zsh-users@zsh.org
Subject: Re: zsh blocks at file truncation
Date: Wed, 25 Sep 2013 12:23:12 +0300	[thread overview]
Message-ID: <ECE6FF52-38C6-4334-90FF-BD5791B27DA9@pp1.inet.fi> (raw)
In-Reply-To: <12896374.TIKZVcXBhR@localhost.localdomain>

Hello,

For a reason unknown with my zsh setup this:

$ > file.txt

creates a new empty file if it does not exist and complains:

zsh: file exists: file.txt

if it exists...

With this:

$ >| file.txt

I can truncate the file and write to it whatever i want like with:

$ cat > file.txt

I must have something setup in my ~/.zshrc for this to work that way, but I'm too lazy to check :D

$ >| file.txt
foo
bar
baz

will end with CTRL-D like with

$ cat > file.txt.

And if I pull what i wrote

$ > file.txt

from history it will give me

$ >| file.txt

Oh dear, what is going on? :D

On Sep 21, 2013, at 10:10 AM, chandan wrote:

> Hi all,
> 
> Like most others I am trying to move from bash to zsh as my default shell.
> 
> On zsh, Why does the following block indefinitely?
> 
> $ >file.txt
> 
> On bash, the above would truncate a file. Also, on bash 'file.txt'
> would be created if it does on exist.
> 
> After some debugging, I found that the above command blocked at the
> invocation of the 'cat' command (as provided by 'ps -c <pid>').
> 
> Thanks,
> chandan
> 


  parent reply	other threads:[~2013-09-25  9:29 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
2013-09-25  8:49 ` zzapper
2013-09-25  9:23 ` Marko Vihoma [this message]
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=ECE6FF52-38C6-4334-90FF-BD5791B27DA9@pp1.inet.fi \
    --to=marko.vihoma@pp1.inet.fi \
    --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).