Skip to content
Snippets Groups Projects
Commit 1a645b04 authored by Marco Del Tufo's avatar Marco Del Tufo
Browse files

re-fixed the fix

parent 78fc1a4d
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
for i in $(find . -type f -name '*.md' -print)
do
echo " -- "
echo " FIXING FILE ${i}..."
for string in `grep -oP '\(https://openbis.readthedocs.io/en/latest/\K[^\)]+' $i`
do
new_string=`echo "/home/marco/openbis/docs/${string}" | sed s/html/md/g | cut -d '#' -f 1`
file2=$new_string
file1=$i
new_string=`realpath --relative-to="$file1" "$file2"`
if [[ $new_string == "." ]]
then
new_string=`basename $i`
new_string="./${new_string}"
fi
if [[ $new_string =~ ^\.\.\/[a-zA-Z]+ ]]
then
new_string="${new_string:1}"
fi
original_string=`echo "https://openbis.readthedocs.io/en/latest/${string}" | cut -d '#' -f 1`
echo $original_string
echo $new_string
#sed -i.bak s,"$original_string","$new_string",g $i
done
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment