prevent word splitting

This commit is contained in:
Bryan Jenks 2020-07-16 08:22:16 -07:00
parent 929c8e3bbc
commit e2384023d0
1 changed files with 2 additions and 2 deletions

4
flash
View File

@ -332,8 +332,8 @@ ${LGREY}Select a number to continue, or${NC} ${LRED}Q${NC} ${LGREY}to quit...${N
# Update item score for each flashcard item # Update item score for each flashcard item
## Remove forward slashes in the Questions and answers ## Remove forward slashes in the Questions and answers
QUESTION_REGEX=$(sed "s/\(\/\|\[\|\]\)/\\\\\1/g" <<< ${q[1]}) QUESTION_REGEX=$(sed "s/\(\/\|\[\|\]\)/\\\\\1/g" <<< "${q[1]}")
ANSWER_REGEX=$(sed "s/\(\/\|\[\|\]\)/\\\\\1/g" <<< ${q[2]}) ANSWER_REGEX=$(sed "s/\(\/\|\[\|\]\)/\\\\\1/g" <<< "${q[2]}")
sed -i "s/${q[0]}:$QUESTION_REGEX:$ANSWER_REGEX:${q[3]}/${q[0]}:$QUESTION_REGEX:$ANSWER_REGEX:$NEW_ITEM_SCORE/g" "$DECK" sed -i "s/${q[0]}:$QUESTION_REGEX:$ANSWER_REGEX:${q[3]}/${q[0]}:$QUESTION_REGEX:$ANSWER_REGEX:$NEW_ITEM_SCORE/g" "$DECK"
# If no highscore currently set, set it. # If no highscore currently set, set it.
if [ -z "$(cat "$HIGH_SCORE")" ]; then if [ -z "$(cat "$HIGH_SCORE")" ]; then