2020-03-03

This commit is contained in:
monlor
2020-03-03 14:19:25 +08:00
parent e4ac7001b9
commit 5f29985e39
15 changed files with 22 additions and 19 deletions

View File

@@ -16,15 +16,15 @@ sedsh() {
[ -z "$1" -o -z "$2" -o -z "$3" ] && echo "null sedsh params!" && exit 1
if [ "$(uname -s)" = "Darwin" ]; then
if [ "$1" = "s" ]; then
sed -i "" "s#$2#$3#g" "$4"
sed -i "" "s/$2/$3/g" "$4"
elif [[ "$1" = "d" ]]; then
sed -i "" "#$2#d" "$3"
sed -i "" "/$2/d" "$3"
fi
else
if [[ "$1" = "s" ]]; then
sed -i "s#$2#$3#g" "$4"
sed -i "s/$2/$3/g" "$4"
elif [[ "$1" = "d" ]]; then
sed -i "#$2#d" "$3"
sed -i "/$2/d" "$3"
fi
fi
}