Re:Um – Create your own man pages so you can remember how to...
by amelius on Monday August 20, 2018 @08:58AM
(#17799525)
Tar is one example of a command with dubious usage syntax. But how about cp?
cp a.txt b/c/d
Will this create a new file "b/c/d/a.txt", or will it create a new file "b/c/d"? It's not clear, and depends on the circumstances (if a directory b/c/d exists). There's a flag to control the behavior, but nobody uses it often, so nobody remembers that flag. The best way to assert that "d" is a directory is by adding a trailing slash, but there's no similar way to assert that "d" should be a file. I suspect that there are many bash scripts that are essentially broken because of this problem.
Rsync has a similar problem.