Last active
July 12, 2020 07:46
-
-
Save rootsongjc/39e3a6758d3f6376bc4b21851c725670 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# replace URL | |
seperator="→" | |
config="filename" | |
#config style | |
#https://a.com→https://b.com | |
destination="destination" | |
for line in `cat $config`;do | |
echo $line | |
before=`echo $line|cut -d $seperator -f1|sed 's#\/#\\\/#g'` | |
after=`echo $line|cut -d $seperator -f2|sed 's#\/#\\\/#g'` | |
sed -i "" "s/$before/$after/g" $destination | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment