[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#61105: cp/mv: want a fatal --no-clobber
From: |
Mike Frysinger |
Subject: |
bug#61105: cp/mv: want a fatal --no-clobber |
Date: |
Fri, 27 Jan 2023 15:52:09 -0500 |
i've been under the mistaken assumption that the -n/--no-clobber option exits
non-zero when the target exists, but someone pointed out to me recently that
it silently ignores existing files. can we get a setting to control this ?
basically i've been writing things like:
if ! cp -n foo bar; then
... error out because bar already exists, or otherwise failed ...
fi
when really i need to write:
if [ -e bar ] || ! cp foo bar; then
... error out ...
fi
-mike
signature.asc
Description: PGP signature
- bug#61105: cp/mv: want a fatal --no-clobber,
Mike Frysinger <=