On 2021/03/07 03:20, Emilio Garcia wrote:
Hi all,
I checked out the coreutils repo on Github and I would like to ask you
to add a dry-run option in the mv command.
----
When I've needed such functionality, I insert an 'echo'
before the 'mv' command, so in a script:
cmd=eval
if ((dry_run)); then
cmd=echo
fi
$cmd mv "fromfile" "tofile"
^^ that way my script will do the actual command like 'mv'
when cmd is set to 'eval', but in the "dry_run" case,
cmd will be set to 'echo' and instead of executing the command,
it will just echo it.
Does that work for you?