mirror of
https://github.com/ossrs/srs.git
synced 2025-11-24 11:54:21 +08:00
add replace script.
This commit is contained in:
26
trunk/scripts/sources_replace.sh
Executable file
26
trunk/scripts/sources_replace.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
from=$1
|
||||
to=$2
|
||||
|
||||
if [[ $from == '' ]]; then
|
||||
echo "replace from must not be empty"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $to == '' ]]; then
|
||||
echo "replace to must not be empty"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "from=$from"
|
||||
echo "to=$to"
|
||||
|
||||
files="configure `ls auto` `ls conf` `ls scripts` `find etc -type f` `find ide -type f` `find research -type f` `find src -type f`"
|
||||
for file in $files; do
|
||||
grep -in "$from" $file >/dev/null 2>&1;
|
||||
if [[ 0 -eq $? ]]; then
|
||||
echo "replace $file";
|
||||
#sed -i '' "s|$from|$to|g" $file;
|
||||
fi;
|
||||
done
|
||||
Reference in New Issue
Block a user