In bash i can truncate a file with:
$ > file
However the same command in zsh
hangs.
Is it possible to configure zsh
to emulate bash
when truncating files?
In bash i can truncate a file with:
$ > file
However the same command in zsh
hangs.
Is it possible to configure zsh
to emulate bash
when truncating files?
Based on the feedback here, I discovered that setting the zsh
NULLCMD
parameter to :
emulates bash.
% NULLCMD=:
% >file
% ls -l file
-rw-r--r-- 1 pfalstad 0 May 24 05:41 file
Source: http://zsh.sourceforge.net/Intro/intro_13.html
NULLCMD
is indeed set to cat
by default
zsh
is not actually hanging, it's accepting input. If you want bash
behaviour use ^D
(ctrl-d) to send an EOF
.