On Thu, 18 Nov 2021 01:30:25 +1100, Reuben ua =?UTF-8?B?QnLDrcSh?= wrote:
> Does anyone know of any shell and utilities where, for example, if
>
> -rf
>
> is a file name, the rm utility will understand so, and not think it is
> a controlling flag (ugh! in-band signalling)? One where an array of
> strings can be past as a single argument? Etc? etc?
This is why POSIX requires utilities to treat "--" as end of options.
That way a script can run:
rm -- $possibly_evil_pattern
and not have things interpreted as options. But if you don't trust
the input I sure hope this rm is not being run in a privileged context.
- todd