[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Worth submitting a pull request to add –dry-run flag to rm?
From: |
Mike Jonkmans |
Subject: |
Re: Worth submitting a pull request to add –dry-run flag to rm? |
Date: |
Tue, 14 Feb 2023 11:34:26 +0100 |
On Tue, Feb 14, 2023 at 12:28:21PM +0300, Benson Muite wrote:
> On 2/14/23 01:29, Robert Viragh wrote:
...
> > Is it worth submitting a high-quality pull request to add a --dry-run flag
> > to the basic Linux rm command (rm --dry-run -rf)
...
> Am not a maintainer, but as a user this seems like it would be helpful
> for people new to the command line. Such a patch may increase the
> maintenance burden.
This would also be helpful for more experienced scripters.
I often give my scripts a -n option, to serve as a dry run option.
Now i need to have code to echo the 'rm'-statements for this case.
If 'rm' would support --dry-run, then that would mean less scripting
and it would be more precise too.
One thing to note is that --dry-run should be affected by the verbosity (-v).
Without -v, nothing should be done on the filesystem.
With -v, do nothing and echo what would be done.
Other options, like -f, -r and -i also may need some thought w.r.t. --dry-run.
The short form could be -s. Alternatives --simulate, ...
'apt-get' uses these.
Other utilities might also profit from such an option, e.g. 'mv'.
But i am not a maintainer either.
--
Regards, Mike Jonkmans