Hello.

If I try in bash this command ex. "rmdir somethingA > somethingA.out
2>&1" work right. But, if I try "rmdir somethingB 2>&1 >
somethingB.out" that work wrong.

That work's wrong in Bash version 4.4.23(1) and too in 5.0.0(1)-rc1:

######### v. 4.4.23(1) #########

$ mkdir /dev/shm/test
$ cd /dev/shm/test
$ rmdir somethingA > somethingA.out 2>&1
$ rmdir somethingB 2>&1 > somethingB.out
rmdir: failed to remove 'somethingB': No such file or directory
$ cat somethingA.out
rmdir: failed to remove 'somethingA': No such file or directory
$ cat somethingB.out
$ bash --version
GNU bash, version 4.4.23(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$


######### 5.0.0(1)-rc1 #########

$ cd bash-5.0-rc1/
$ ./bash
$ echo $BASH_VERSION
5.0.0(1)-rc1
$ mkdir /dev/shm/test
$ cd /dev/shm/test
$ rmdir somethingA > somethingA.out 2>&1
$ rmdir somethingB 2>&1 > somethingB.out
rmdir: failed to remove 'somethingB': No such file or directory
$ cat somethingA.out
rmdir: failed to remove 'somethingA': No such file or directory
$ cat somethingB.out
$

Dušan Kreheľ

Reply via email to