coreutils
coreutils copied to clipboard
`split` should refuse to overwrite the input file
Using GNU, all these commands are failing:
#export C=./target/debug/coreutils
rm -f xaa in2 in3
seq 10 | tee exp-1 > xaa
ln -s xaa in2
ln xaa in3
$C split -C 6 xaa
$C split -C 6 in2
$C split -C 6 in3
$C split -C 6 - < xaa
=>
# GNU:
$C split -C 6 xaa
split: 'xaa' would overwrite input; aborting
$C split -C 6 in2
split: 'xaa' would overwrite input; aborting
$C split -C 6 in3
split: 'xaa' would overwrite input; aborting
$C split -C 6 - < xaa
split: 'xaa' would overwrite input; aborting
All these commands pass with our version. Test upstream: https://github.com/coreutils/coreutils/blob/master/tests/split/guard-input.sh
Hi, can I work on this? @sylvestre
@TheAlakazam Of course!