Anshul Nigham wrote:
> Hi
> 
> Using wildcard expansion, it is possible to unintentionally overwrite
> files. E.g. consider a directory with two text files, a.txt and b.txt.
> 
> $ cp *.txt
> $ cat b.txt
> I am A!!
> 
> I don't think this could be intended or expected behavior in any
> scenario. I suggest that the cp behavior be modified to look for a
> destination file operand before expanding wildcards

cp doesn't expand wildcards, the shell does.
So all cp sees is the individual params: a.txt b.txt

Pádraig.


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to