mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

wikiupdate (242B)


      1 #!/bin/bash
      2 
      3 # in wiki folder FOLDER, replace links to FROM to links to TO
      4 
      5 FOLDER="$1"
      6 FROM="$2"
      7 TO="$3"
      8 
      9 cd "$HOME/$FOLDER"
     10 grep -RlF "[$FROM]" | while read a; do
     11   if [ -f $a ]; then
     12     sed -i "s/\[$FROM\]/\[$TO\]/g" $a
     13   fi
     14 done
     15 
     16 exit 0