diff options
author | Alexey Shpakovsky <alexey@shpakovsky.ru> | 2014-03-18 23:49:16 +0100 |
---|---|---|
committer | Alexey Shpakovsky <alexey@shpakovsky.ru> | 2014-03-18 23:50:25 +0100 |
commit | 5cbeaa9ad83d6d7f090a56bdea5b0a6c29b9e1d1 (patch) | |
tree | ab8e6fda4d1c6840c3a4a2d1383a5667d5c94c3e | |
parent | 1dea4161dac346a1f36c80dc18d25ad474132c71 (diff) |
use expr to clean tags RegExp way
-rwxr-xr-x | bb.sh | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -744,7 +744,7 @@ rebuild_tags() { # 'split' tags by commas echo "$line" | cut -c 10- | while IFS="," read -a tags; do for dirty_tag in "${tags[@]}"; do # extract html around it - tag="$(echo $dirty_tag | grep -o ">.*</a>" | awk '{print substr($0, 2, length($0)-5)}' | tr " " "_")" + tag="$(expr "$dirty_tag" : ".*>\(.*\)</a" | tr " " "_")" # Add the content of this post to the tag file cat "$tmpfile" >> "$prefix_tags$tag".tmp.html done |