Closed bjorkstromm closed 9 years ago
We need to get automated tests using dash, since that's the default shell in Ubuntu...
Until then, do you have access to a Ubuntu machine (or other machine with dash installed) to give it a quick try there and make sure >|
works in dash?
Otherwise, looks good to me! Thanks! /cc @BrennanConroy
According to manual, dash uses >|
[n]> file Redirect standard output (or n) to file.
[n]>| file Same, but override the -C option.
Also verified on my own computer:
$ touch foobar
$ dash -C -c "echo 'foobar' > foobar"
dash: 1: cannot create foobar: File exists
$ dash -C -c "echo 'foobar' >| foobar"
$ cat foobar
foobar
Looks good to me. :shipit: @BrennanConroy, could you take it in?
Fixes #423
@anurse would it be beneficial to run all tests with
noclobber
option?Accoring to the Unix Power Tools Book the Z shell understands both
!
and|
, therefore I'm not using any shell checking indnvm.sh
Regarding checking current shell, unlike the original PR, I'm not checking
$SHELL
variable as this will only return default shell, therefore checking$BASH_VERSION
or$ZSH_VERSION
would be more safe.