3 ms·
Ouch, that is a sharp corner: $ echo 'aaa' > a.txt $ echo 'bbb' > b.txt $ TMP_DIR="" # Mistake! Missing arg, failed search, typo'd name, etc. $
by BoppreH 4y ago
Ouch, that is a sharp corner:
$ echo 'aaa' > a.txt
$ echo 'bbb' > b.txt
$ TMP_DIR="" # Mistake! Missing arg, failed search, typo'd name, etc.
$ cp a.txt b.txt $TMP_DIR
$ cat b.txt
aaa
$ # The contents of b.txt are lost.
- nextaccountic 4y agocp itself should have been two commands, or at least accept two flags for those two very different semantics. Actually there's a wave of unixy tools being written in Go and Rust and I think there might be a suitable cp replacement already, but it's up to distros to package it.