Update post2blog.sh
This commit is contained in:
parent
f1aeb5a41d
commit
1b97379188
@ -157,7 +157,7 @@ if [[ ${_title} != 'Null' ]]; then
|
|||||||
while read _oneline
|
while read _oneline
|
||||||
do
|
do
|
||||||
#first get all hyper links, including websites, images and files. save them to a single string separated by whitespace
|
#first get all hyper links, including websites, images and files. save them to a single string separated by whitespace
|
||||||
_link_string=${_link_string}`echo "${_oneline}" | grep -Eo "!?\[[a-zA-Z0-9 _:/.-]*\]\([a-zA-Z0-9_:/.-]*\)"`" "
|
_link_string=${_link_string}`echo "${_oneline}" | grep -Eo "!?\[[^]]*\]\([^)]*\)"`" "
|
||||||
echo "${_oneline}" >> ${_tmpfile}
|
echo "${_oneline}" >> ${_tmpfile}
|
||||||
done < ${_mfile}
|
done < ${_mfile}
|
||||||
else
|
else
|
||||||
@ -177,7 +177,7 @@ else
|
|||||||
_outfile_end=${_oneline:2}
|
_outfile_end=${_oneline:2}
|
||||||
else
|
else
|
||||||
#first get all hyper links, including websites, images and files. save them to a single string separated by whitespace
|
#first get all hyper links, including websites, images and files. save them to a single string separated by whitespace
|
||||||
_link_string=${_link_string}`echo "${_oneline}" | grep -Eo "!?\[[a-zA-Z0-9 _:/.-]*\]\([a-zA-Z0-9_:/.-]*\)"`" "
|
_link_string=${_link_string}`echo "${_oneline}" | grep -Eo "!?\[[^]]*\]\([^)]*\)"`" "
|
||||||
echo "${_oneline}" >> ${_tmpfile}
|
echo "${_oneline}" >> ${_tmpfile}
|
||||||
fi
|
fi
|
||||||
done < ${_mfile}
|
done < ${_mfile}
|
||||||
@ -209,7 +209,7 @@ _outfile=${_outfile}${_outfile_end}.md
|
|||||||
|
|
||||||
#echo ${_link_string}
|
#echo ${_link_string}
|
||||||
#get link names from _link_string and save a string
|
#get link names from _link_string and save a string
|
||||||
_link_names_string=`echo ${_link_string} | grep -Eo "\[[a-zA-Z0-9 _:/.-]*\]"`
|
_link_names_string=`echo ${_link_string} | grep -Eo "\[[^]]*\]"`
|
||||||
#change whitespace in every link name into -
|
#change whitespace in every link name into -
|
||||||
_link_names_string=${_link_names_string//" "/"-"}
|
_link_names_string=${_link_names_string//" "/"-"}
|
||||||
#delete symbols \[ and \] in link names
|
#delete symbols \[ and \] in link names
|
||||||
@ -222,7 +222,7 @@ _link_names=(${_link_names_string})
|
|||||||
#done
|
#done
|
||||||
|
|
||||||
#get link addresses from _link_string and save a string
|
#get link addresses from _link_string and save a string
|
||||||
_link_addresses_string=`echo ${_link_string} | grep -Eo "\([a-zA-Z0-9_:/.-]*\)"`
|
_link_addresses_string=`echo ${_link_string} | grep -Eo "\([^)]*\)"`
|
||||||
#echo ${_link_addresses_string}
|
#echo ${_link_addresses_string}
|
||||||
#change whitespace in every link address into -
|
#change whitespace in every link address into -
|
||||||
_link_addresses_string=${_link_addresses_string//" "/"-"}
|
_link_addresses_string=${_link_addresses_string//" "/"-"}
|
||||||
|
Loading…
Reference in New Issue
Block a user