.profile: Add replace function
This commit is contained in:
parent
97df9ababf
commit
03b5f2a289
9
.profile
9
.profile
@ -234,6 +234,15 @@ if has ptgdp; then
|
|||||||
echo "$*" | ptgdp -p
|
echo "$*" | ptgdp -p
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
if has sed && has find; then
|
||||||
|
replace() {
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
echo "replace: Requires two arguments"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
find . -type f -exec sed -i "s/$1/$2/g" {} \;
|
||||||
|
}
|
||||||
|
fi
|
||||||
if has sudo; then
|
if has sudo; then
|
||||||
case $_baseshell in
|
case $_baseshell in
|
||||||
*bash|*zsh)
|
*bash|*zsh)
|
||||||
|
Loading…
Reference in New Issue
Block a user