Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh blocks at file truncation
- X-seq: zsh-users 17999
- From: Marko Vihoma <marko.vihoma@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: zsh blocks at file truncation
- Date: Wed, 25 Sep 2013 12:23:12 +0300
- In-reply-to: <12896374.TIKZVcXBhR@localhost.localdomain>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <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
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author