projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5958bb4
)
doc: improve sample backup script
author
Jim Meyering
<meyering@redhat.com>
Fri, 29 Jun 2012 08:45:31 +0000
(10:45 +0200)
committer
Jim Meyering
<meyering@redhat.com>
Sat, 30 Jun 2012 09:00:32 +0000
(11:00 +0200)
* doc/coreutils.texi (cp invocation): Make the backup script exit
with an accurate reflection of any failure.
Also, add --preserve=all.
Improved-by: Bernhard Voelker
doc/coreutils.texi
patch
|
blob
|
history
diff --git
a/doc/coreutils.texi
b/doc/coreutils.texi
index
08ef2d8
..
954a1f8
100644
(file)
--- a/
doc/coreutils.texi
+++ b/
doc/coreutils.texi
@@
-7675,9
+7675,11
@@
combination of options is this tiny Bourne shell script:
#!/bin/sh
# Usage: backup FILE...
# Create a @sc{gnu}-style backup of each listed FILE.
+fail=0
for i; do
- cp --backup --force --
"$i" "$i"
+ cp --backup --force --
preserve=all -- "$i" "$i" || fail=1
done
+exit $fail
@end example
@item --copy-contents