projects
/
carnet-tools-cn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r70: ispravke cp_check_and_sed
[carnet-tools-cn.git]
/
functions.sh
diff --git
a/functions.sh
b/functions.sh
index
d1a1e7c
..
4b3013d
100644
(file)
--- a/
functions.sh
+++ b/
functions.sh
@@
-192,7
+192,6
@@
cp_check_and_sed() {
[ "$CP_SCRIPT_DEBUG" ] && set -vx
local s sedcmd grepret ret i
if [ -z "$3" ]; then
[ "$CP_SCRIPT_DEBUG" ] && set -vx
local s sedcmd grepret ret i
if [ -z "$3" ]; then
- echo "Usage: cp_check_and_sed <regexp> <sed> <file> [file ...]" 2>&1
return 1
fi
s="$1"
return 1
fi
s="$1"
@@
-209,7
+208,7
@@
cp_check_and_sed() {
fi
[ -h "$i" ] && i=$(readlink -f "$i")
sed "$sedcmd" "$i" > "$i.dpkg-tmp"
fi
[ -h "$i" ] && i=$(readlink -f "$i")
sed "$sedcmd" "$i" > "$i.dpkg-tmp"
- if [ ! "$?" = "0" ]; then
+ if [ $? -ne 0 ]; then
rm "$i.dpkg-tmp"
echo "cp_check_and_sed: Problem with sed" 1>&2
return 5
rm "$i.dpkg-tmp"
echo "cp_check_and_sed: Problem with sed" 1>&2
return 5